fix(ilm): constrain restored-copy cleanup to verified tiered versions

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-11-03 20:55:22 +08:00
parent 30588eb830
commit e7103d77cb
5 changed files with 297 additions and 4 deletions
+5
View File
@@ -1498,6 +1498,11 @@ func (x *xlMetaV2) DeleteVersion(fi FileInfo) (string, error) {
}
switch {
case fi.ExpireRestored:
// Only a completed transition has a remote copy. Trust the selected
// stored version, not the transition status supplied by the caller.
if string(ver.ObjectV2.MetaSys[metaTierStatus]) != lifecycle.TransitionComplete {
return "", nil
}
ver.ObjectV2.RemoveRestoreHdrs()
err = x.setIdx(i, *ver)
case fi.TransitionStatus == lifecycle.TransitionComplete: