Skip to content

Commit

Permalink
fix(auth_v2): don't change system_auth
Browse files Browse the repository at this point in the history
If consistent topology is enabled then auth-v2 is enabled, and
we don't need to change RF or topology for system_auth keyspace.
  • Loading branch information
enaydanov authored and fruch committed Sep 16, 2024
1 parent c6f39d0 commit fd0a08c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion add_new_dc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def test_add_new_dc(self) -> None: # pylint: disable=too-many-locals

self.log.info("Starting add new DC test...")
assert self.params.get('n_db_nodes').endswith(" 0"), "n_db_nodes must be a list and last dc must equal 0"
system_keyspaces = ["system_auth", "system_distributed", "system_traces"]
system_keyspaces = ["system_distributed", "system_traces"]
# auth-v2 is used when consistent topology is enabled
if not self.db_cluster.nodes[0].raft.is_consistent_topology_changes_enabled:
system_keyspaces.insert(0, "system_auth")

# reconfigure system keyspaces to use NetworkTopologyStrategy
status = self.db_cluster.get_nodetool_status()
Expand Down
4 changes: 3 additions & 1 deletion sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -4615,7 +4615,9 @@ def disrupt_add_remove_dc(self) -> None:
"add_remove_dc skipped for multi-dc scenario (https://github.com/scylladb/scylla-cluster-tests/issues/5369)")
InfoEvent(message='Starting New DC Nemesis').publish()
node = self.cluster.nodes[0]
system_keyspaces = ["system_auth", "system_distributed", "system_traces"]
system_keyspaces = ["system_distributed", "system_traces"]
if not node.raft.is_consistent_topology_changes_enabled: # auth-v2 is used when consistent topology is enabled
system_keyspaces.insert(0, "system_auth")
self._switch_to_network_replication_strategy(self.cluster.get_test_keyspaces() + system_keyspaces)
datacenters = list(self.tester.db_cluster.get_nodetool_status().keys())
self.tester.create_keyspace("keyspace_new_dc", replication_factor={
Expand Down
3 changes: 3 additions & 0 deletions sdcm/tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,9 @@ def set_system_auth_rf(self, db_cluster=None):
if self.test_config.REUSE_CLUSTER:
self.log.debug("Skipping change rf of system_auth for reusing cluster")
return
if db_cluster.nodes[0].raft.is_consistent_topology_changes_enabled:
self.log.debug("Skipping change rf of system_auth because with consistent topology auth-v2 is enabled")
return
self.set_ks_strategy_to_network_and_rf_according_to_cluster(keyspace="system_auth", db_cluster=db_cluster)

def set_ks_strategy_to_network_and_rf_according_to_cluster(self, keyspace, db_cluster=None, repair_after_alter=True):
Expand Down

0 comments on commit fd0a08c

Please sign in to comment.