locator: Recognize rack list RF as valid in assert_rf_rack_valid_keyspace()

This commit is contained in:
Tomasz Grabiec
2025-07-31 00:59:44 +02:00
parent e5b7452af2
commit 6b7b0cb628
2 changed files with 8 additions and 2 deletions

View File

@@ -129,7 +129,8 @@ Glossary
RF-rack-valid keyspace
A keyspace with :doc:`tablets </architecture/tablets>` enabled is RF-rack-valid if all of its data centers
have the :term:`Replication Factor (RF) <Replication Factor (RF)>` of 0, 1, or the number of racks in that data center.
have the :term:`Replication Factor (RF) <Replication Factor (RF)>`, which is either a rack list, or numerical
of value 0, 1, or the number of racks in that data center.
Keyspaces with tablets disabled are always deemed RF-rack-valid, even if they do not satisfy the aforementioned condition.

View File

@@ -1291,7 +1291,12 @@ void assert_rf_rack_valid_keyspace(std::string_view ks, const token_metadata_ptr
}
}
const size_t rf = nts.get_replication_factor(dc);
auto rf_data = nts.get_replication_factor_data(dc);
if (!rf_data || rf_data->is_rack_based()) {
continue;
}
auto rf = rf_data->count();
// We must not allow for a keyspace to become RF-rack-invalid. Any attempt at that must be rejected.
// For more context, see: scylladb/scylladb#23276.