From d9b1fb7a7cb0813dd12d8f73423662e02a458056 Mon Sep 17 00:00:00 2001 From: sum12 Date: Tue, 10 Sep 2024 13:22:29 +0200 Subject: [PATCH] move more zookeeper related calls in try..catch block --- src/Storages/StorageReplicatedMergeTree.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index 724dcfcda23..9c650f07a02 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -548,6 +548,10 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree( createNewZooKeeperNodes(); syncPinnedPartUUIDs(); + if (!has_metadata_in_zookeeper.has_value() || *has_metadata_in_zookeeper) + createTableSharedID(); + + } catch (...) { @@ -556,9 +560,6 @@ StorageReplicatedMergeTree::StorageReplicatedMergeTree( throw; } - if (!has_metadata_in_zookeeper.has_value() || *has_metadata_in_zookeeper) - createTableSharedID(); - initialization_done = true; }