From 72871dbb9ab5d007195faf91b0effad12351e2ab Mon Sep 17 00:00:00 2001 From: Poorna Date: Thu, 5 Oct 2023 20:09:45 -0700 Subject: [PATCH] delete replication: avoid overwriting replication decision (#18174) from ObjectInfo unless version purge status is present. Otherwise there is potential to make incorrect replication decision if Stat returned an error --- cmd/bucket-replication.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/bucket-replication.go b/cmd/bucket-replication.go index 10522d0a9..26c134d5f 100644 --- a/cmd/bucket-replication.go +++ b/cmd/bucket-replication.go @@ -376,8 +376,10 @@ func checkReplicateDelete(ctx context.Context, bucket string, dobj ObjectToDelet } else { // can be the case that other cluster is down and duplicate `mc rm --vid` // is issued - this still needs to be replicated back to the other target - replicate = oi.VersionPurgeStatus == Pending || oi.VersionPurgeStatus == Failed - dsc.Set(newReplicateTargetDecision(tgtArn, replicate, sync)) + if !oi.VersionPurgeStatus.Empty() { + replicate = oi.VersionPurgeStatus == Pending || oi.VersionPurgeStatus == Failed + dsc.Set(newReplicateTargetDecision(tgtArn, replicate, sync)) + } continue } }