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
This commit is contained in:
Poorna
2023-10-05 20:09:45 -07:00
committed by GitHub
parent 4bda4e4e2b
commit 72871dbb9a
+4 -2
View File
@@ -376,8 +376,10 @@ func checkReplicateDelete(ctx context.Context, bucket string, dobj ObjectToDelet
} else { } else {
// can be the case that other cluster is down and duplicate `mc rm --vid` // 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 // is issued - this still needs to be replicated back to the other target
replicate = oi.VersionPurgeStatus == Pending || oi.VersionPurgeStatus == Failed if !oi.VersionPurgeStatus.Empty() {
dsc.Set(newReplicateTargetDecision(tgtArn, replicate, sync)) replicate = oi.VersionPurgeStatus == Pending || oi.VersionPurgeStatus == Failed
dsc.Set(newReplicateTargetDecision(tgtArn, replicate, sync))
}
continue continue
} }
} }