-
Notifications
You must be signed in to change notification settings - Fork 98
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
refactor(nemesis): modified compaction strategies related nemeses #9913
base: master
Are you sure you want to change the base?
Conversation
e8b0b64
to
201fe69
Compare
201fe69
to
6ab5ec1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmetic changes.
this PR need several test runs before merging due to the random nature
sdcm/nemesis.py
Outdated
'min_threshold': 4, | ||
'max_threshold': 32, | ||
}, | ||
def calculate_strategy_params(strategy_class): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think. method calculate_strategy_params and "Dict strategies" are unnecessary here
you can use "list strategies" as previously, just extend it with lambda and random
if (current_size // 24) > 2: | ||
current_unit = "DAYS" | ||
current_size = 3 | ||
compaction = settings["compaction"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary change value "compaction" is not used rather than the next 2 lines
sdcm/nemesis.py
Outdated
"gc": 864000, | ||
"dttl": 86400} | ||
|
||
""" Adjust window unit and size with random increments in acceptable borders, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is too short comment for such function
sdcm/nemesis.py
Outdated
"DAYS": 365, | ||
} | ||
|
||
random_escalation_sizes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary dict
sdcm/nemesis.py
Outdated
"DAYS": (2, 14), | ||
} | ||
|
||
def escalate_unit(unit: str) -> (str, int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be just Dict instead of functions with if-elif-else statement
current_size = int(settings["compaction"].get("compaction_window_size") or 1) # default value | ||
multiplier = 3600 if current_unit in ["DAYS", "HOURS"] else 60 | ||
self.log.debug("Initial twcs settings are: %s", settings) | ||
MAX_TTL = 4_300_000 # ~49 days in seconds | ||
expected_sstable_number = 35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't understand why previous logic has hardcoded the number 35.
sdcm/nemesis.py
Outdated
if proposed_ttl > MAX_TTL: | ||
# Recalculate a smaller window size so we do not exceed MAX_TTL | ||
# integer division to keep it safe | ||
max_size = MAX_TTL // (multiplier * expected_sstable_number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current_size = MAX_TTL // (multiplier * expected_sstable_number)
if max_size < 1:
current_size = 1
sdcm/nemesis.py
Outdated
settings["gc"] = proposed_ttl // 2 | ||
settings["dttl"] = proposed_ttl | ||
|
||
compaction["compaction_window_unit"] = current_unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary change
461a353
to
c639b95
Compare
modify_table_twcs_window_size nemesis to set twcs borders in wider range. modified modify_table_compaction nemesis to set compaction strategies params in wider range to adjust test coverage. refs: 9361, 9362
c639b95
to
18f775d
Compare
modify_table_twcs_window_size nemesis modified to test twcs strategy in wider borders
modify_table_compaction nemesis modified for the same purposes.
Both collected in single commit due to modify_table_twcs_window_size nemesis depends on modify_table_compaction (ie modify_table_compaction nemesis adds randomness that should affect modify_table_twcs_window_size)
refs: 9361, 9362
fixes: #9361, #9362
Testing
https://jenkins.scylladb.com/view/staging/job/scylla-staging/job/eugene_test_folder/job/twcs_cluster_without_changes/59/
PR pre-checks (self review)
backport
labelsReminders
sdcm/sct_config.py
)unit-test/
folder)