Merge pull request #59288 from azat/rmt/drop-update-zk

Use fresh ZooKeeper client on DROP (to have higher chances on success)
This commit is contained in:
Alexey Milovidov 2024-01-28 13:16:21 +01:00 committed by GitHub
commit 29d54dab55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1096,6 +1096,8 @@ void StorageReplicatedMergeTree::drop()
/// Table can be shut down, restarting thread is not active
/// and calling StorageReplicatedMergeTree::getZooKeeper()/getAuxiliaryZooKeeper() won't suffice.
zookeeper = getZooKeeperIfTableShutDown();
/// Update zookeeper client, since existing may be expired, while ZooKeeper is required inside dropAllData().
current_zookeeper = zookeeper;
/// If probably there is metadata in ZooKeeper, we don't allow to drop the table.
if (!zookeeper)