mirror of
https://github.com/minio/minio.git
synced 2025-01-12 07:23:23 -05:00
fix: delete marker permanent delete replication (#11581)
This commit is contained in:
parent
f28b063091
commit
2dce5d9442
@ -179,6 +179,14 @@ func checkReplicateDelete(ctx context.Context, bucket string, dobj ObjectToDelet
|
|||||||
if err != nil || rcfg == nil {
|
if err != nil || rcfg == nil {
|
||||||
return false, false, sync
|
return false, false, sync
|
||||||
}
|
}
|
||||||
|
opts := replication.ObjectOpts{
|
||||||
|
Name: dobj.ObjectName,
|
||||||
|
SSEC: crypto.SSEC.IsEncrypted(oi.UserDefined),
|
||||||
|
UserTags: oi.UserTags,
|
||||||
|
DeleteMarker: oi.DeleteMarker,
|
||||||
|
VersionID: dobj.VersionID,
|
||||||
|
}
|
||||||
|
replicate = rcfg.Replicate(opts)
|
||||||
// when incoming delete is removal of a delete marker( a.k.a versioned delete),
|
// when incoming delete is removal of a delete marker( a.k.a versioned delete),
|
||||||
// GetObjectInfo returns extra information even though it returns errFileNotFound
|
// GetObjectInfo returns extra information even though it returns errFileNotFound
|
||||||
if gerr != nil {
|
if gerr != nil {
|
||||||
@ -187,7 +195,7 @@ func checkReplicateDelete(ctx context.Context, bucket string, dobj ObjectToDelet
|
|||||||
case replication.Pending, replication.Completed, replication.Failed:
|
case replication.Pending, replication.Completed, replication.Failed:
|
||||||
validReplStatus = true
|
validReplStatus = true
|
||||||
}
|
}
|
||||||
if oi.DeleteMarker && validReplStatus {
|
if oi.DeleteMarker && (validReplStatus || replicate) {
|
||||||
return oi.DeleteMarker, true, sync
|
return oi.DeleteMarker, true, sync
|
||||||
}
|
}
|
||||||
// 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`
|
||||||
@ -200,14 +208,7 @@ func checkReplicateDelete(ctx context.Context, bucket string, dobj ObjectToDelet
|
|||||||
if tgt == nil {
|
if tgt == nil {
|
||||||
return oi.DeleteMarker, false, false
|
return oi.DeleteMarker, false, false
|
||||||
}
|
}
|
||||||
opts := replication.ObjectOpts{
|
return oi.DeleteMarker, replicate, tgt.replicateSync
|
||||||
Name: dobj.ObjectName,
|
|
||||||
SSEC: crypto.SSEC.IsEncrypted(oi.UserDefined),
|
|
||||||
UserTags: oi.UserTags,
|
|
||||||
DeleteMarker: oi.DeleteMarker,
|
|
||||||
VersionID: dobj.VersionID,
|
|
||||||
}
|
|
||||||
return oi.DeleteMarker, rcfg.Replicate(opts), tgt.replicateSync
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// replicate deletes to the designated replication target if replication configuration
|
// replicate deletes to the designated replication target if replication configuration
|
||||||
|
Loading…
Reference in New Issue
Block a user