make sure to set Versioned field to ensure rename2 is not called (#18141)

without this the rename2() can rename the previous dataDir
causing issues for different versions of the object, only
latest version is preserved due to this bug.

Added healing code to ensure recovery of such content.
This commit is contained in:
Harshavardhana
2023-09-29 09:08:24 -07:00
committed by GitHub
parent dd8547e51c
commit c34bdc33fb
3 changed files with 44 additions and 8 deletions

View File

@@ -496,13 +496,16 @@ func (er erasureObjects) deleteIfDangling(ctx context.Context, bucket, object st
m, ok := isObjectDangling(metaArr, errs, dataErrs)
if ok {
tags := make(map[string]interface{}, 4)
tags["size"] = m.Size
tags["set"] = er.setIndex
tags["pool"] = er.poolIndex
tags["merrs"] = errors.Join(errs...)
tags["derrs"] = errors.Join(dataErrs...)
tags["mtime"] = m.ModTime.Format(http.TimeFormat)
tags["parity"] = m.Erasure.ParityBlocks
if m.IsValid() {
tags["size"] = m.Size
tags["mtime"] = m.ModTime.Format(http.TimeFormat)
tags["parity"] = m.Erasure.ParityBlocks
}
if cok {
tags["caller"] = fmt.Sprintf("%s:%d", file, line)
}