mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Do not drop parts for static (ro/write-once) storages for Replicated engine
Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
e56728ae6c
commit
6751e01cc3
@ -2740,6 +2740,15 @@ void MergeTreeData::renameInMemory(const StorageID & new_table_id)
|
||||
|
||||
void MergeTreeData::dropAllData()
|
||||
{
|
||||
/// In case there is read-only/write-once disk we cannot allow to call dropAllData(), but dropping tables is allowed.
|
||||
///
|
||||
/// Note, that one may think that drop on write-once disk should be
|
||||
/// supported, since it is pretty trivial to implement
|
||||
/// MetadataStorageFromPlainObjectStorageTransaction::removeDirectory(),
|
||||
/// however removing part requires moveDirectory() as well.
|
||||
if (isStaticStorage())
|
||||
return;
|
||||
|
||||
LOG_TRACE(log, "dropAllData: waiting for locks.");
|
||||
auto settings_ptr = getSettings();
|
||||
|
||||
|
@ -319,9 +319,6 @@ void StorageMergeTree::checkTableCanBeDropped(ContextPtr query_context) const
|
||||
void StorageMergeTree::drop()
|
||||
{
|
||||
shutdown(true);
|
||||
/// In case there is read-only disk we cannot allow to call dropAllData(), but dropping tables is allowed.
|
||||
if (isStaticStorage())
|
||||
return;
|
||||
dropAllData();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user