Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update snitch/location config selection #781

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ccmlib/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ def populate(self, nodes, debug=False, tokens=None, use_vnodes=None, ipprefix='1
self.use_vnodes = use_vnodes

if isinstance(nodes, list):
# We set PFS here as a "marker" that we need to read cassandra-topology.properties for this cluster
# This is then checked in node.py::_update_yaml where we check if initial_location_provider is set in
# the yaml (indicating that modern config is supported) and we set TopologyFileLocationProvider if so
self.set_configuration_options(values={'endpoint_snitch': 'org.apache.cassandra.locator.PropertyFileSnitch'})

node_count = 0
i = 0
for c in nodes:
Expand Down
14 changes: 14 additions & 0 deletions ccmlib/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -1766,6 +1766,20 @@ def _update_yaml(self):
self.cluster._config_options,
self.__config_options, delete_empty=False)

if 'endpoint_snitch' in full_options and full_options['endpoint_snitch'] == 'org.apache.cassandra.locator.PropertyFileSnitch':
# multi dc cluster, needs to read cassandra-topology.properties - if cassandra.yaml is modern, we use TFLP and unset the endpoint_snitch
if 'initial_location_provider' in data:
data['initial_location_provider'] = 'org.apache.cassandra.locator.TopologyFileLocationProvider'
full_options.pop('endpoint_snitch', None)
else:
# test might set endpoint_snitch: GPFS for example, in this case we need to keep that and unset ILP (or other way round)
if 'initial_location_provider' in full_options:
data.pop('endpoint_snitch', None)
elif 'endpoint_snitch' in full_options:
data.pop('initial_location_provider', None)
data.pop('node_proximity', None)


# Merge options with original yaml data.
data = common.merge_configuration(data, full_options)

Expand Down
Loading