From 0c666379feefdb6a9c4ef22a38808250ddfe1b50 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 26 Jul 2021 15:15:34 -0700 Subject: [PATCH] fix: avoid removing healed parts on dstDataPath (#12795) destination path and old path will be similar when healing occurs, this can lead to healed parts being again purged leading to always an inconsistent state on an object which might further cause reduction in quorum eventually. --- cmd/xl-storage.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index 2a1a55a57..1a9a9b2fe 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -2054,6 +2054,12 @@ func (s *xlStorage) RenameData(ctx context.Context, srcVolume, srcPath string, f // Purge the destination path as we are not preserving anything // versioned object was not requested. oldDstDataPath = pathJoin(dstVolumeDir, dstPath, ofi.DataDir) + // if old destination path is same as new destination path + // there is nothing to purge, this is true in case of healing + // avoid setting oldDstDataPath at that point. + if oldDstDataPath == dstDataPath { + oldDstDataPath = "" + } xlMeta.data.remove(nullVersionID, ofi.DataDir) } }