This commit is contained in:
Alexander Tokmakov 2023-11-29 17:12:04 +01:00
parent 67f0a0e3e4
commit 9f849fbe06

View File

@ -1186,7 +1186,10 @@ void DatabaseReplicated::dropReplica(
auto zookeeper = Context::getGlobalContextInstance()->getZooKeeper();
String database_mark = zookeeper->get(database_zookeeper_path);
String database_mark;
bool db_path_exists = zookeeper->tryGet(database_zookeeper_path, database_mark);
if (!db_path_exists && !throw_if_noop)
return;
if (database_mark != REPLICATED_DATABASE_MARK)
throw Exception(ErrorCodes::BAD_ARGUMENTS, "Path {} does not look like a path of Replicated database", database_zookeeper_path);