fix auxiliary zookeepers

This commit is contained in:
Alexander Tokmakov 2024-02-20 22:41:49 +01:00
parent 45d407034f
commit 4b11735680
3 changed files with 6 additions and 3 deletions

View File

@ -976,7 +976,7 @@ ZooKeeperPtr ZooKeeper::startNewSession() const
void ZooKeeper::initSession()
{
String session_path = fs::path(args.sessions_path) / toString(DB::ServerUUID::get());
String session_path = fs::path(args.sessions_path) / args.zookeeper_name / toString(DB::ServerUUID::get());
Coordination::Stat stat;
if (trySet(session_path, "", -1, &stat) == Coordination::Error::ZOK)
{
@ -991,7 +991,7 @@ void ZooKeeper::initSession()
void ZooKeeper::addCheckSessionOp(Coordination::Requests & requests) const
{
String session_path = fs::path(args.sessions_path) / toString(DB::ServerUUID::get());
String session_path = fs::path(args.sessions_path) / args.zookeeper_name / toString(DB::ServerUUID::get());
requests.push_back(zkutil::makeCheckRequest(session_path, session_node_version));
}

View File

@ -132,6 +132,8 @@ void ZooKeeperArgs::initFromKeeperServerSection(const Poco::Util::AbstractConfig
void ZooKeeperArgs::initFromKeeperSection(const Poco::Util::AbstractConfiguration & config, const std::string & config_name)
{
zookeeper_name = config_name;
Poco::Util::AbstractConfiguration::Keys keys;
config.keys(config_name, keys);
@ -195,7 +197,7 @@ void ZooKeeperArgs::initFromKeeperSection(const Poco::Util::AbstractConfiguratio
}
else if (key == "sessions_path")
{
chroot = config.getString(config_name + "." + key);
sessions_path = config.getString(config_name + "." + key);
}
else if (key == "implementation")
{

View File

@ -29,6 +29,7 @@ struct ZooKeeperArgs
ZooKeeperArgs() = default;
bool operator == (const ZooKeeperArgs &) const = default;
String zookeeper_name = "zookeeper";
String implementation = "zookeeper";
Strings hosts;
String auth_scheme;