From b0264bdb902f448e57529b3dbe444d1d539814e1 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Wed, 29 Nov 2023 00:31:33 +0800 Subject: [PATCH] preserve null version delete marker on suspended bucket version (#18547) --- cmd/xl-storage-format-v2.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/xl-storage-format-v2.go b/cmd/xl-storage-format-v2.go index 72a058f05..b9b84068e 100644 --- a/cmd/xl-storage-format-v2.go +++ b/cmd/xl-storage-format-v2.go @@ -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)