Add a check for missing entity during local alias invalidation. (#14622)

This commit is contained in:
Nick Cabatoff 2022-03-21 15:09:31 -04:00 committed by GitHub
parent 6ca6b028f8
commit 34af6bab1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

3
changelog/14622.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
replication (enterprise): fix panic due to missing entity during invalidation of local aliases.
```

View File

@ -773,6 +773,10 @@ func (i *IdentityStore) Invalidate(ctx context.Context, key string) {
i.logger.Error("failed to fetch entity during local alias invalidation", "entity_id", alias.CanonicalID, "error", err)
return
}
if entity == nil {
i.logger.Error("failed to fetch entity during local alias invalidation, missing entity", "entity_id", alias.CanonicalID, "error", err)
continue
}
// Delete local aliases from the entity.
err = i.deleteAliasesInEntityInTxn(txn, entity, []*identity.Alias{alias})