Skip to content

[Backport perf-v15] fix(LoaderUtilsMixin): table_enabled was allways True as this feature is allways enabled #10625

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

Merged
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
3 changes: 1 addition & 2 deletions sdcm/fill_db_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3186,8 +3186,7 @@ def enable_cdc_for_tables(self) -> bool:
@cached_property
def tablets_enabled(self) -> bool:
"""Check is tablets enabled on cluster"""
with self.db_cluster.cql_connection_patient(self.db_cluster.nodes[0]) as session:
return is_tablets_feature_enabled(session)
return is_tablets_feature_enabled(self.db_cluster.nodes[0])

@retrying(n=3, sleep_time=20, allowed_exceptions=ProtocolException)
def truncate_table(self, session, truncate): # pylint: disable=no-self-use
Expand Down
28 changes: 12 additions & 16 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,10 +1005,9 @@ def disrupt_restart_with_resharding(self):
"Run 'disrupt_nodetool_flush_and_reshard_on_kubernetes' instead")

# If tablets in use, skipping resharding since it is not supported.
with self.cluster.cql_connection_patient(self.target_node) as session:
if is_tablets_feature_enabled(session=session):
if SkipPerIssues('https://github.com/scylladb/scylladb/issues/16739', params=self.tester.params):
raise UnsupportedNemesis('https://github.com/scylladb/scylladb/issues/16739')
if is_tablets_feature_enabled(self.target_node):
if SkipPerIssues('https://github.com/scylladb/scylladb/issues/16739', params=self.tester.params):
raise UnsupportedNemesis('https://github.com/scylladb/scylladb/issues/16739')

murmur3_partitioner_ignore_msb_bits = 15 # pylint: disable=invalid-name
self.log.info(f'Restart node with resharding. New murmur3_partitioner_ignore_msb_bits value: '
Expand Down Expand Up @@ -1424,10 +1423,9 @@ def disrupt_nodetool_flush_and_reshard_on_kubernetes(self):
if not self._is_it_on_kubernetes():
raise UnsupportedNemesis('It is supported only on kubernetes')
# If tablets in use, skipping resharding since it is not supported.
with self.cluster.cql_connection_patient(self.target_node) as session:
if is_tablets_feature_enabled(session=session):
if SkipPerIssues('https://github.com/scylladb/scylladb/issues/16739', params=self.tester.params):
raise UnsupportedNemesis('https://github.com/scylladb/scylladb/issues/16739')
if is_tablets_feature_enabled(self.target_node):
if SkipPerIssues('https://github.com/scylladb/scylladb/issues/16739', params=self.tester.params):
raise UnsupportedNemesis('https://github.com/scylladb/scylladb/issues/16739')

dc_idx = 0
for node in self.cluster.nodes:
Expand Down Expand Up @@ -1710,10 +1708,9 @@ def disrupt_nodetool_refresh(self, big_sstable: bool = False):
# NOTE: resharding happens only if we have more than 1 core.
# We may have 1 core in a K8S multitenant setup.
# If tablets in use, skipping resharding validation since it doesn't work the same as vnodes
with self.cluster.cql_connection_patient(self.cluster.nodes[0]) as session:
if shards_num > 1 and not is_tablets_feature_enabled(session=session):
SstableLoadUtils.validate_resharding_after_refresh(
node=node, system_log_follower=system_log_follower)
if shards_num > 1 and not is_tablets_feature_enabled(self.cluster.nodes[0]):
SstableLoadUtils.validate_resharding_after_refresh(
node=node, system_log_follower=system_log_follower)

# Verify that the special key is loaded by SELECT query
result = self.target_node.run_cqlsh(query_verify)
Expand Down Expand Up @@ -5103,10 +5100,9 @@ def _wait_for_tablets_balanced(self, node):
if not node.raft.is_enabled:
self.log.info("Raft is disabled, skipping wait for balance")
return
with self.cluster.cql_connection_patient(node=node) as session:
if not is_tablets_feature_enabled(session):
self.log.info("Tablets are disabled, skipping wait for balance")
return
if not is_tablets_feature_enabled(node):
self.log.info("Tablets are disabled, skipping wait for balance")
return
time.sleep(60) # one minute gap before checking, just to give some time to the state machine
client = RemoteCurlClient(host="127.0.0.1:10000", endpoint="", node=node)
self.log.info("Waiting for tablets to be balanced")
Expand Down
13 changes: 9 additions & 4 deletions sdcm/utils/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

CONSISTENT_TOPOLOGY_CHANGES_FEATURE = "SUPPORTS_CONSISTENT_TOPOLOGY_CHANGES"
CONSISTENT_CLUSTER_MANAGEMENT_FEATURE = "SUPPORTS_RAFT_CLUSTER_MANAGEMENT"
TABLETS_FEATURE = "TABLETS"

LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -71,8 +70,14 @@ def is_consistent_topology_changes_feature_enabled(session: Session) -> bool:
return CONSISTENT_TOPOLOGY_CHANGES_FEATURE in get_enabled_features(session)


def is_tablets_feature_enabled(session: Session) -> bool:
def is_tablets_feature_enabled(node) -> bool:
""" Check whether tablets enabled
if you need from a specific node use `patient_exclusive_cql_connection` session
"""
return TABLETS_FEATURE in get_enabled_features(session)
with node.remote_scylla_yaml() as scylla_yaml:
# for backward compatibility of 2024.1 and earlier
if "tablets" in scylla_yaml.experimental_features:
return True
if scylla_yaml.dict().get("enable_tablets"):
return True

return False