diff --git a/dbms/src/Common/ZooKeeper/ZooKeeper.cpp b/dbms/src/Common/ZooKeeper/ZooKeeper.cpp index 591cc6171ba..1154310ef42 100644 --- a/dbms/src/Common/ZooKeeper/ZooKeeper.cpp +++ b/dbms/src/Common/ZooKeeper/ZooKeeper.cpp @@ -151,7 +151,12 @@ struct ZooKeeperArgs hosts += host; } - hosts += root; + if (!root.empty()) + { + if (root.front() != '/') + throw KeeperException(std::string("Root path in config file should starts with '/', but got ") + root); + hosts += root; + } } std::string hosts;