mirror of https://github.com/minio/minio.git
ensure ILM expiry creates non null deleteMarker for versioned bucket (#15947)
This commit is contained in:
parent
8afa6fefd8
commit
7dd8b6c8ed
|
@ -1549,6 +1549,9 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string
|
||||||
|
|
||||||
storageDisks := er.getDisks()
|
storageDisks := er.getDisks()
|
||||||
|
|
||||||
|
// Determine whether to mark object deleted for replication
|
||||||
|
var markDelete bool
|
||||||
|
|
||||||
if opts.Expiration.Expire {
|
if opts.Expiration.Expire {
|
||||||
goi, _, err := er.getObjectInfoAndQuorum(ctx, bucket, object, opts)
|
goi, _, err := er.getObjectInfoAndQuorum(ctx, bucket, object, opts)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -1573,20 +1576,21 @@ func (er erasureObjects) DeleteObject(ctx context.Context, bucket, object string
|
||||||
Object: object,
|
Object: object,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
markDelete = goi.VersionID != ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
versionFound := !(opts.DeleteMarker && opts.VersionID != "")
|
versionFound := !(opts.DeleteMarker && opts.VersionID != "")
|
||||||
|
|
||||||
// Determine whether to mark object deleted for replication
|
if !markDelete {
|
||||||
markDelete := !opts.DeleteMarker && opts.VersionID != ""
|
markDelete = !opts.DeleteMarker && opts.VersionID != ""
|
||||||
|
}
|
||||||
// Default deleteMarker to true if object is under versioning
|
// Default deleteMarker to true if object is under versioning
|
||||||
// versioning suspended means we add `null` version as
|
// versioning suspended means we add `null` version as
|
||||||
// delete marker, if its not decided already.
|
// delete marker, if its not decided already.
|
||||||
deleteMarker := (opts.Versioned || opts.VersionSuspended) && opts.VersionID == "" || (opts.DeleteMarker && opts.VersionID != "")
|
deleteMarker := (opts.Versioned || opts.VersionSuspended) && opts.VersionID == "" || (opts.DeleteMarker && opts.VersionID != "")
|
||||||
|
|
||||||
if markDelete {
|
if markDelete && opts.VersionID != "" {
|
||||||
// case where replica version needs to be deleted on target cluster
|
// case where replica version needs to be deleted on target cluster
|
||||||
if versionFound && opts.DeleteMarkerReplicationStatus() == replication.Replica {
|
if versionFound && opts.DeleteMarkerReplicationStatus() == replication.Replica {
|
||||||
markDelete = false
|
markDelete = false
|
||||||
|
|
Loading…
Reference in New Issue