mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
Currently the locator::topology object, when created, does not contain local node, but it is started to be used to access local database. It sort of work now because there are explicit checks in the code to handle this special case like in topology::get_location for instance. We do not want to hack around it and instead rely on an invariant that the local node is always there. To do that we add local node during locator::topology creation. There is a catch though. Unlike with IP host ID is not known during startup. We actually need to read from the database to know it, so the topology starts with host ID zero and then it changes once to the real one. This is not a problem though. As long as the (one node) topology is consistent (_cfg.this_host_id is equal to the node's id) local access will work.