Skip to content

[Backport 2026.1] feat(monkey): extract encryption nemeses into own module - #15787

Open
scylladbbot wants to merge 1 commit into
scylladb:branch-2026.1from
scylladbbot:backport/15607/to-2026.1
Open

[Backport 2026.1] feat(monkey): extract encryption nemeses into own module#15787
scylladbbot wants to merge 1 commit into
scylladb:branch-2026.1from
scylladbbot:backport/15607/to-2026.1

Conversation

@scylladbbot

Copy link
Copy Markdown
  • New file sdcm/nemesis/monkey/encryption.py (222 lines): EnableDisableTableEncryptionBaseMonkey holds the shared _enable_disable_table_encryption() logic (AWS KMS setup, encrypted table create/write/read via scylla-bench, optional key rotation, disable+verify), with two thin subclasses — EnableDisableTableEncryptionAwsKmsProviderWithRotationMonkey and ...WithoutRotationMonkey.
  • sdcm/nemesis/init.py: 5473→5299 lines (-174). Removed both disrupt_* methods and the _enable_disable_table_encryption helper; pruned now-unused imports (AwsKms, ScyllaBenchEvent, cql_quote_if_needed) and a leftover breadcrumb comment.
  • sdcm/nemesis/monkey/init.py: 920→900 lines (-20). Removed the two thin Monkey classes (auto-discovered via the existing pkgutil.walk_packages mechanism — no manual import needed). Also removed the dead target_pool = NEMESIS_TARGET_POOLS.all_nodes line, since @target_all_nodes already sets that same attribute (DISRUPT_POOL_PROPERTY_NAME == "target_pool") — confirmed with the advisor this was pure copy-paste noise, not needed for backward compat.
  • New tests unit_tests/unit/nemesis/monkey/test_encryption.py (9 tests): AWS-backend guard, @scylla_versions guard, full with/without-rotation disrupt flows, user_info_encryption skip-disable path, and class flags.

Key technical point for future phases: this is the first migration of a @scylla_versions-decorated method into a monkey class. The decorator internally does getattr(cls_self, "cluster", cls_self), so I added a cluster property on the base monkey (return self.runner.cluster) — verified experimentally that this satisfies the decorator correctly. Worth reusing for Phase 4 (disrupt_mgmt_restore) and Phase 10 (compaction), which also carry @scylla_versions.

Closes: SCT-213

Testing

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)

  • Add unit tests to cover my changes (under unit-test/ folder)

  • Update the Readme/doc folder relevant to this change (if needed)

  • (cherry picked from commit 81cd900)

Parent PR: #15607

@scylladbbot

Copy link
Copy Markdown
Author

@cezarmoise - This PR has conflicts, therefore it was moved to draft
Please resolve them and mark this PR as ready for review by removing the conflicts label

@github-actions github-actions Bot added the P2 High Priority label Aug 14, 2026
@scylladbbot scylladbbot added this to the 2026.1.12 milestone Aug 14, 2026
@cezarmoise
cezarmoise force-pushed the backport/15607/to-2026.1 branch from 248e810 to 44a8269 Compare August 14, 2026 13:58
@cezarmoise
cezarmoise marked this pull request as ready for review August 14, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 High Priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants