mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Fix for write-once storages
This commit is contained in:
parent
ec69b28386
commit
08f4621b48
@ -687,9 +687,11 @@ std::unique_ptr<WriteBufferFromFileBase> DiskObjectStorageTransaction::writeFile
|
||||
{
|
||||
if (mode == WriteMode::Rewrite)
|
||||
{
|
||||
/// Otherwise we will produce lost blobs which nobody points to
|
||||
if (tx->metadata_storage.exists(path))
|
||||
// Otherwise we will produce lost blobs which nobody points to
|
||||
/// WriteOnce storages are not affected by the issue
|
||||
if (!tx->object_storage.isWriteOnce() && tx->metadata_storage.exists(path))
|
||||
tx->object_storage.removeObjectsIfExist(tx->metadata_storage.getStorageObjects(path));
|
||||
|
||||
tx->metadata_transaction->createMetadataFile(path, blob_name, count);
|
||||
}
|
||||
else
|
||||
@ -717,7 +719,8 @@ std::unique_ptr<WriteBufferFromFileBase> DiskObjectStorageTransaction::writeFile
|
||||
if (mode == WriteMode::Rewrite)
|
||||
{
|
||||
/// Otherwise we will produce lost blobs which nobody points to
|
||||
if (object_storage_tx->metadata_storage.exists(path))
|
||||
/// WriteOnce storages are not affected by the issue
|
||||
if (!object_storage_tx->object_storage.isWriteOnce() && object_storage_tx->metadata_storage.exists(path))
|
||||
{
|
||||
object_storage_tx->object_storage.removeObjectsIfExist(
|
||||
object_storage_tx->metadata_storage.getStorageObjects(path));
|
||||
|
Loading…
Reference in New Issue
Block a user