From 1d03bea965e7bdee45a5eff1ee5fc6ba1a526580 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 24 Apr 2024 18:14:08 -0700 Subject: [PATCH] support preserving renameData() on inlined content during overwrites (#19609) extending #19548 to inlined-data as well. --- cmd/xl-storage.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index 1f03b2adf..ee9815856 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -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 - // we backup existing xl.meta -> xl.meta.bkp - this is done to - // ensure for some reason we didn't get enough quorum we can - // revert this back to original xl.meta and preserve the older dataDir. - if notInline && res.OldDataDir != "" { + // If we have oldDataDir then we must preserve current xl.meta + // as backup, in-case needing renames(). + if res.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 legacyPreserved {