mirror of
https://github.com/pgsty/minio.git
synced 2026-07-21 05:00:22 +03:00
preserve conflicting objects when parent object is being deleted (#19034)
a/prefix a/prefix/1.txt where `a/prefix` is an object which does not have `/` at the end, we do not have to aggressively recursively delete all the sub-folders as well. Instead convert the call into self contained to deleting 'xl.meta' and then subsequently attempting to Remove the parent.
This commit is contained in:
+2
-2
@@ -1146,7 +1146,7 @@ func (s *xlStorage) deleteVersions(ctx context.Context, volume, path string, fis
|
|||||||
return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf)
|
return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.deleteFile(volumeDir, pathJoin(volumeDir, path), true, false)
|
return s.deleteFile(volumeDir, pathJoin(volumeDir, path, xlStorageFormatFile), true, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteVersions deletes slice of versions, it can be same object
|
// DeleteVersions deletes slice of versions, it can be same object
|
||||||
@@ -1307,7 +1307,7 @@ func (s *xlStorage) DeleteVersion(ctx context.Context, volume, path string, fi F
|
|||||||
return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf)
|
return s.WriteAll(ctx, volume, pathJoin(path, xlStorageFormatFile), buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.deleteFile(volumeDir, filePath, true, false)
|
return s.deleteFile(volumeDir, pathJoin(volumeDir, path, xlStorageFormatFile), true, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Updates only metadata for a given version.
|
// Updates only metadata for a given version.
|
||||||
|
|||||||
Reference in New Issue
Block a user