mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Update StorageReplicatedMergeTree.cpp
This commit is contained in:
parent
581e57be9f
commit
a7efdd7f4e
@ -7645,7 +7645,15 @@ void StorageReplicatedMergeTree::createTableSharedID() const
|
||||
return;
|
||||
}
|
||||
|
||||
auto zookeeper = getZooKeeper();
|
||||
/// We may call getTableSharedID when table is shut down. If exception happen, restarting thread will be already turned
|
||||
/// off and nobody will reconnect our zookeeper connection. In this case we use zookeeper connection from
|
||||
/// context.
|
||||
ZooKeeperPtr zookeeper;
|
||||
if (shutdown_called.load())
|
||||
zookeeper = getZooKeeperIfTableShutDown();
|
||||
else
|
||||
zookeeper = getZooKeeper();
|
||||
|
||||
String zookeeper_table_id_path = fs::path(zookeeper_path) / "table_shared_id";
|
||||
String id;
|
||||
if (!zookeeper->tryGet(zookeeper_table_id_path, id))
|
||||
|
Loading…
Reference in New Issue
Block a user