preserve null version delete marker on suspended bucket version (#18547)

This commit is contained in:
jiuker 2023-11-29 00:31:33 +08:00 committed by GitHub
parent 95d6f43cc8
commit b0264bdb90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1415,7 +1415,10 @@ func (x *xlMetaV2) DeleteVersion(fi FileInfo) (string, error) {
if fi.MarkDeleted && (fi.VersionPurgeStatus().Empty() || (fi.VersionPurgeStatus() != Complete)) {
err = x.addVersion(ventry)
}
return "", err
// if we remove null version. we should try to add null version to top layer.
if uv.String() != emptyUUID {
return "", err
}
case ObjectType:
if updateVersion && !fi.Deleted {
ver, err := x.getIdx(i)