topology: set self host_id on the new topology

With this commit, we begin the next stage of the
refactoring - updating the new version of the token_metadata
in all places where the old version is currently being updated.

In this commit we assign host_id of this node, both in main.cc
and in boost tests.
This commit is contained in:
Petr Gusev
2023-10-22 18:32:06 +04:00
parent e4253776a1
commit 66c30e4f8e
2 changed files with 9 additions and 0 deletions

View File

@@ -1212,6 +1212,8 @@ To start the scylla server proper, simply invoke as: scylla server (or just scyl
// still be found in the config.
tm.get_topology().set_host_id_cfg(host_id);
tm.get_topology().add_or_update_endpoint(endpoint, host_id);
tm.get_new()->get_topology().set_host_id_cfg(host_id);
tm.get_new()->get_topology().add_or_update_endpoint(endpoint, host_id);
return make_ready_future<>();
}).get();

View File

@@ -648,6 +648,13 @@ private:
std::nullopt,
locator::node::state::normal,
smp::count);
auto& topo_new = tm.get_new()->get_topology();
topo_new.set_host_id_cfg(hostid);
topo_new.add_or_update_endpoint(utils::fb_utilities::get_broadcast_address(),
hostid,
std::nullopt,
locator::node::state::normal,
smp::count);
return make_ready_future<>();
}).get();