From 540f8532cb90b0b99c9168ee569cb26f1e5fd086 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 11 Jun 2020 22:59:15 +0300 Subject: [PATCH] Fix error --- src/Storages/StorageReplicatedMergeTree.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Storages/StorageReplicatedMergeTree.cpp b/src/Storages/StorageReplicatedMergeTree.cpp index bb12bf98481..809536f7452 100644 --- a/src/Storages/StorageReplicatedMergeTree.cpp +++ b/src/Storages/StorageReplicatedMergeTree.cpp @@ -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);