From 033ab12ba7a54bd75dda602356a713a91ace1956 Mon Sep 17 00:00:00 2001 From: Naman Jain Date: Wed, 16 Aug 2023 13:23:39 +0530 Subject: [PATCH] chore(raft): better logging message for cleaning banned ns pred (#7886) Co-authored-by: Aman Mangal --- worker/draft.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/worker/draft.go b/worker/draft.go index 9a9a3f4f486..5f39570182f 100644 --- a/worker/draft.go +++ b/worker/draft.go @@ -612,7 +612,15 @@ func (n *node) applyCommitted(proposal *pb.Proposal, key uint64) error { proposal.CleanPredicate, proposal.ExpectedChecksum) return nil } - return posting.DeletePredicate(ctx, proposal.CleanPredicate, proposal.StartTs) + err := posting.DeletePredicate(ctx, proposal.CleanPredicate, proposal.StartTs) + if err == badger.ErrBannedKey { + // Zero might send the delete predicate instruction to alpha when updating the + // membership state. This can happen for predicates from banned namespaces too. + glog.Warningf("Couldn't clean the predicate %s as it is already banned.", + proposal.CleanPredicate) + return nil + } + return err case proposal.Delta != nil: n.elog.Printf("Applying Oracle Delta for key: %d", key)