mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
zookeeper: fixed error when createIfNotExists can throw error due to netwrok error
This commit is contained in:
parent
b62e0ed395
commit
458eb3086c
@ -234,7 +234,8 @@ int32_t ZooKeeper::tryCreateWithRetries(const std::string& path, const std::stri
|
||||
|
||||
void ZooKeeper::createIfNotExists(const std::string & path, const std::string & data)
|
||||
{
|
||||
int32_t code = retry(boost::bind(&ZooKeeper::tryCreate, this, boost::ref(path), boost::ref(data), zkutil::CreateMode::Persistent));
|
||||
std::string pathCreated;
|
||||
int32_t code = retry(boost::bind(&ZooKeeper::createImpl, this, boost::ref(path), boost::ref(data), zkutil::CreateMode::Persistent, boost::ref(pathCreated)));
|
||||
|
||||
if (code == ZOK || code == ZNODEEXISTS)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user