From 6e7aea61cc4e2669556d00e360c3b43ad2b5aec6 Mon Sep 17 00:00:00 2001 From: Marc Boudreau Date: Wed, 24 Jul 2024 15:28:46 -0400 Subject: [PATCH] pre-delete changed entity in invalidation --- vault/identity_store.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vault/identity_store.go b/vault/identity_store.go index a6af9a2b5b52..22196269c8ff 100644 --- a/vault/identity_store.go +++ b/vault/identity_store.go @@ -742,6 +742,11 @@ func (i *IdentityStore) invalidateEntityBucket(ctx context.Context, key string) i.logger.Error("failed to remove entity aliases from changed entity", "entity_id", memDBEntity.ID, "error", err) return } + + if err := i.MemDBDeleteEntityByIDInTxn(txn, memDBEntity.ID); err != nil { + i.logger.Error("failed to delete changed entity", "entity_id", memDBEntity.ID, "error", err) + return + } } err = i.upsertEntityInTxn(ctx, txn, bucketEntity, nil, false)