Merge pull request #11614 from ClickHouse/fixup-replica-create-drop

Fixup for recent replica CREATE/DROP changes.
This commit is contained in:
alexey-milovidov 2020-06-12 01:41:21 +03:00 committed by GitHub
commit 37d7e9a60a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -564,8 +564,7 @@ void StorageReplicatedMergeTree::createReplica()
Coordination::Stat replicas_stat;
String replicas_value;
code = zookeeper->tryGet(zookeeper_path + "/replicas", replicas_value, &replicas_stat);
if (code == Coordination::ZNONODE)
if (!zookeeper->tryGet(zookeeper_path + "/replicas", replicas_value, &replicas_stat))
throw Exception(fmt::format("Cannot create a replica of the table {}, because the last replica of the table was dropped right now",
zookeeper_path), ErrorCodes::ALL_REPLICAS_LOST);