fix: preserve shared-version metadata during overwrite rollback

Signed-off-by: Feng Ruohang <rh@vonng.com>
This commit is contained in:
Feng Ruohang
2026-10-25 01:11:27 +08:00
parent 0501a198e3
commit 8a4097309f
2 changed files with 53 additions and 15 deletions
+6
View File
@@ -2840,6 +2840,12 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, f
xlMeta.data.remove(reqVID, dataDir)
}
}
if !healing && res.OldDataDir == "" {
// Shared data must survive both commit and rollback. Keep the
// previous metadata in a separate transaction directory instead
// of using a data directory still owned by another version.
res.OldDataDir = fi.DataDir + "-rollback"
}
}
if err = xlMeta.AddVersion(fi); err != nil {