Merge pull request #14926 from ClickHouse/better-drop-replicated-table

Better drop for Replicated tables
This commit is contained in:
alesapin 2020-09-18 09:51:39 +03:00 committed by GitHub
commit 3536ac1b17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -697,7 +697,9 @@ void StorageReplicatedMergeTree::drop()
if (has_metadata_in_zookeeper)
{
auto zookeeper = tryGetZooKeeper();
/// Table can be shut down, restarting thread is not active
/// and calling StorageReplicatedMergeTree::getZooKeeper() won't suffice.
auto zookeeper = global_context.getZooKeeper();
/// If probably there is metadata in ZooKeeper, we don't allow to drop the table.
if (is_readonly || !zookeeper)