Skip to content

test(collect_diagnosis_data_test): Add ScyllaDiagnosisReport nemesis #10536

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions collect_diagnosis_data_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright (c) 2025 ScyllaDB

from sdcm.tester import ClusterTester
from sdcm import nemesis


class ScyllaDiagnosisReport(ClusterTester):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually we don't add new tests - only in specific cases.
For this should utilize 'individual nemesis' case


def test_diagnosis_data(self): # pylint: disable=invalid-name
current_nemesis = nemesis.ScyllaDiagnosisReport(
tester_obj=self, termination_event=self.db_cluster.nemesis_termination_event)
current_nemesis.disrupt()
2 changes: 2 additions & 0 deletions configurations/nemesis/ScyllaDiagnosisReport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nemesis_class_name: 'ScyllaDiagnosisReport'
user_prefix: 'ScyllaDiagnosisReport'
1 change: 1 addition & 0 deletions data_dir/nemesis_classes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- RollingRestartConfigChangeInternodeCompression
- ScyllaKillMonkey
- SerialRestartOfElectedTopologyCoordinatorNemesis
- ScyllaDiagnosisReport
- SlaDecreaseSharesDuringLoad
- SlaIncreaseSharesByAttachAnotherSlDuringLoad
- SlaIncreaseSharesDuringLoad
Expand Down
13 changes: 13 additions & 0 deletions jenkins-pipelines/oss/features/sigquit-scylla-test.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!groovy

// trick from https://github.com/jenkinsci/workflow-cps-global-lib-plugin/pull/43
def lib = library identifier: 'sct@snapshot', retriever: legacySCM(scm)

longevityPipeline(
params: params,

backend: 'aws',
region: 'eu-west-1',
test_name: 'collect_diagnosis_data_test.ScyllaDiagnosisReport.test_diagnosis_data',
test_config: 'test-cases/features/diagnosis-report.yaml'
)
4 changes: 4 additions & 0 deletions sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -988,6 +988,10 @@ def instance_name(self) -> str:
"""
return self.name

@property
def is_diagnostics_logged(self):
return self.remoter.run("grep 'Diagnostics dump requested via SIGQUIT' /var/log/messages", ignore_status=True).exit_status == 0

@property
def is_spot(self):
return False
Expand Down
28 changes: 28 additions & 0 deletions sdcm/nemesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,18 @@ def _kill_scylla_daemon(self):
self.target_node.wait_jmx_up()
self.cluster.wait_for_schema_agreement()

def _sigquit_scylla_daemon(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw. we have already generate_coredump_file method in BaseNode class - this could reuse your new method and print diagnosis dump.
Also add node log message with DbNodeLogger about this signal

self.log.info('Sending SIGQUIT to scylla processes in %s',
self.target_node)
self.target_node.remoter.sudo("pkill -3 scylla", ignore_status=True)
# Wait for few seconds before checking diagnosis data
time.sleep(30)
if self.target_node.is_diagnostics_logged:
self.log.info("Diagnosis dump report is found")
else:
self.log.error("Diagonosis dump report is missing")
raise Exception("Diagonosis dump report not found")

@decorate_with_context(ignore_raft_topology_cmd_failing)
@target_all_nodes
def disrupt_stop_wait_start_scylla_server(self, sleep_time=300): # pylint: disable=invalid-name
Expand Down Expand Up @@ -1744,6 +1756,14 @@ def wait_for_old_node_to_removed():
def disrupt_kill_scylla(self):
self._kill_scylla_daemon()

def disrupt_sigquit_scylla(self):
stress_cmd = self.tester.params.get('stress_cmd')
self.tester.run_stress_thread(
stress_cmd=stress_cmd, stress_num=1, stats_aggregate_cmds=False)
Comment on lines +1759 to +1762
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nemesis rather don't run stress_cmd - unless it is by specific design (like doubling load)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, will move it outside nemesis.

# Wait for 5 mins before sending signal
time.sleep(300)
self._sigquit_scylla_daemon()

def disrupt_no_corrupt_repair(self):

if SkipPerIssues("https://github.com/scylladb/scylladb/issues/18059", self.tester.params):
Expand Down Expand Up @@ -6612,6 +6632,14 @@ def disrupt(self):
self.disrupt_nodetool_flush_and_reshard_on_kubernetes()


class ScyllaDiagnosisReport(Nemesis):
disruptive = False
kubernetes = False

def disrupt(self):
self.disrupt_sigquit_scylla()


class ScyllaKillMonkey(Nemesis):
disruptive = True
supports_high_disk_utilization = True
Expand Down
13 changes: 13 additions & 0 deletions test-cases/features/diagnosis-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
test_duration: 30
stress_cmd: "cassandra-stress write no-warmup cl=QUORUM duration=10m -schema 'replication(strategy=NetworkTopologyStrategy,replication_factor=3)' -mode cql3 native -rate threads=60 -pop seq=1..30000000"
n_db_nodes: 3
n_loaders: 1
n_monitor_nodes: 1

instance_type_db: 'i4i.large'
nemesis_class_name: 'ScyllaDiagnosisReport'
nemesis_interval: 5

email_recipients: ['[email protected]']
stress_image:
cassandra-stress: 'scylladb/cassandra-stress:3.13.0'
2 changes: 1 addition & 1 deletion unit_tests/test_nemesis_sisyphus.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_list_all_available_nemesis(generate_file=True):
disruption_list, disruptions_dict, disruption_classes = sisyphus.get_list_of_disrupt_methods(
subclasses_list=subclasses, export_properties=True)

assert len(disruption_list) == 92
assert len(disruption_list) == 93

if generate_file:
with open(sct_abs_path('data_dir/nemesis.yml'), 'w', encoding="utf-8") as outfile1:
Expand Down