mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: an odd crash when deleting null DEL markers (#18727)
fixes #18724 A regression was introduced in #18547, that attempted to file adding a missing `null` marker however we should not skip returning based on versionID instead it must be based on if we are being asked to create a DEL marker or not. The PR also has a side-affect for replicating `null` marker permanent delete, as it may end up adding a `null` marker while removing one. This PR should address both scenarios.
This commit is contained in:
@@ -1410,15 +1410,13 @@ func (x *xlMetaV2) DeleteVersion(fi FileInfo) (string, error) {
|
||||
err = x.setIdx(i, *ver)
|
||||
return "", err
|
||||
}
|
||||
var err error
|
||||
x.versions = append(x.versions[:i], x.versions[i+1:]...)
|
||||
if fi.MarkDeleted && (fi.VersionPurgeStatus().Empty() || (fi.VersionPurgeStatus() != Complete)) {
|
||||
err = x.addVersion(ventry)
|
||||
} else if fi.Deleted && uv.String() == emptyUUID {
|
||||
return "", x.addVersion(ventry)
|
||||
}
|
||||
// if we remove null version. we should try to add null version to top layer.
|
||||
if uv.String() != emptyUUID {
|
||||
return "", err
|
||||
}
|
||||
return "", err
|
||||
case ObjectType:
|
||||
if updateVersion && !fi.Deleted {
|
||||
ver, err := x.getIdx(i)
|
||||
|
||||
Reference in New Issue
Block a user