mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +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()
|
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.");
|
LOG_TRACE(log, "dropAllData: waiting for locks.");
|
||||||
auto settings_ptr = getSettings();
|
auto settings_ptr = getSettings();
|
||||||
|
|
||||||
|
@ -319,9 +319,6 @@ void StorageMergeTree::checkTableCanBeDropped(ContextPtr query_context) const
|
|||||||
void StorageMergeTree::drop()
|
void StorageMergeTree::drop()
|
||||||
{
|
{
|
||||||
shutdown(true);
|
shutdown(true);
|
||||||
/// In case there is read-only disk we cannot allow to call dropAllData(), but dropping tables is allowed.
|
|
||||||
if (isStaticStorage())
|
|
||||||
return;
|
|
||||||
dropAllData();
|
dropAllData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user