Fix check deletion in anti-entropy sync (#7690)

* Incorporate entMeta into service equality check
This commit is contained in:
Freddy 2020-04-23 10:16:50 -06:00 committed by GitHub
parent 54b8a410a9
commit d46ef80751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -1098,8 +1098,11 @@ func (l *State) deleteService(key structs.ServiceID) error {
delete(l.services, key)
// service deregister also deletes associated checks
for _, c := range l.checks {
if c.Deleted && c.Check != nil && c.Check.ServiceID == key.ID {
l.pruneCheck(c.Check.CompoundCheckID())
if c.Deleted && c.Check != nil {
sid := c.Check.CompoundServiceID()
if sid.Matches(&key) {
l.pruneCheck(c.Check.CompoundCheckID())
}
}
}
l.logger.Info("Deregistered service", "service", key.ID)