Skip to content

Commit

Permalink
fix(_get_keyspaces_to_decrease_rf): Address a case where no keyspace …
Browse files Browse the repository at this point in the history
…RF value of DC

In case no keyspace replication-factor value is retrieved in a DC,
A warning is logged and the keyspace is ignored (skipped).
Fixes: #8694
  • Loading branch information
yarongilor authored and fruch committed Sep 15, 2024
1 parent 92febe8 commit e57d75b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sdcm/utils/replication_strategy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,12 @@ def _get_keyspaces_to_decrease_rf(self, session) -> list:
continue # Skip keyspace using SimpleStrategy

if 'NetworkTopologyStrategy' in replication['class']:
rf = int(replication.get(self.datacenter))
if rf == self.original_nodes_number:
rf = replication.get(self.datacenter)
if rf is None:
LOGGER.warning(
f"Datacenter {self.datacenter} not found in replication strategy for keyspace {keyspace_name}.")
continue
if int(rf) == self.original_nodes_number:
matching_keyspaces.append(keyspace_name)
else:
LOGGER.warning("Unexpected replication strategy found: %s", replication['class'])
Expand Down

0 comments on commit e57d75b

Please sign in to comment.