locator: abstract_replication_strategy: implement local_replication_strategy

Derive both vnode_effective_replication_map
and local_effective_replication_map from
static_effective_replication_map as both are static and per-keyspace.

However, local_effective_replication_map does not need vnodes
for the mapping of all tokens to the local node.

Note that everywhere_replication_strategy is not abstracted in a similar
way, although it could, since the plan is to get rid of it
once all system keyspaces areconverted to local or tablets replication
(and propagated everywhere if needed using raft group0)

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2025-07-27 16:51:10 +03:00
parent 8bde507232
commit 6dbbb80aae
11 changed files with 253 additions and 56 deletions

View File

@@ -74,7 +74,8 @@ static void verify_sorted(const dht::token_range_vector& trv) {
BOOST_CHECK(std::ranges::adjacent_find(trv, not_strictly_before) == trv.end());
}
static future<> check_ranges_are_sorted(static_effective_replication_map_ptr erm, locator::host_id ep) {
static future<> check_ranges_are_sorted(static_effective_replication_map_ptr ermp, locator::host_id ep) {
auto* erm = ermp->maybe_as_vnode_effective_replication_map();
verify_sorted(co_await erm->get_ranges(ep));
verify_sorted(co_await erm->get_primary_ranges(ep));
verify_sorted(co_await erm->get_primary_ranges_within_dc(ep));