support preserving renameData() on inlined content during overwrites (#19609)

extending #19548 to inlined-data as well.
This commit is contained in:
Harshavardhana 2024-04-24 18:14:08 -07:00 committed by GitHub
parent fbfeb59658
commit 1d03bea965
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2760,11 +2760,9 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, f
} }
} }
// When we are not inlined and there is no oldDataDir present // If we have oldDataDir then we must preserve current xl.meta
// we backup existing xl.meta -> xl.meta.bkp - this is done to // as backup, in-case needing renames().
// ensure for some reason we didn't get enough quorum we can if res.OldDataDir != "" {
// revert this back to original xl.meta and preserve the older dataDir.
if notInline && res.OldDataDir != "" {
// preserve current xl.meta inside the oldDataDir. // preserve current xl.meta inside the oldDataDir.
if err = s.writeAll(ctx, dstVolume, pathJoin(dstPath, res.OldDataDir, xlStorageFormatFileBackup), dstBuf, true, skipParent); err != nil { if err = s.writeAll(ctx, dstVolume, pathJoin(dstPath, res.OldDataDir, xlStorageFormatFileBackup), dstBuf, true, skipParent); err != nil {
if legacyPreserved { if legacyPreserved {