Repository navigation
Make finished_mutations_to_keep=0 mean "keep no finished mutations" - #104876
nikitamikhaylov wants to merge 1 commit into
Conversation
Previously, setting `finished_mutations_to_keep` to 0 was interpreted as "keep all finished mutation entries" (the cleanup code returned early on the zero value). Flip the semantics so that 0 means "do not keep any finished mutation entry" - the natural reading of the setting name. Update the setting's inline documentation, the ALTER docs, and the two existing tests that asserted the old behaviour. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
finished_mutations_to_keep=0 mean "keep no finished mutations"
|
Workflow [PR], commit [1c22c40] Summary: ❌
AI ReviewSummaryThis PR flips PR Metadata
Findings
Final Verdict
|
| @@ -1,4 +1,4 @@ | |||
| mutations after ALTER for data_rmt 1 | |||
| mutations after cleanup for data_rmt 1 | |||
| mutations after cleanup for data_rmt 0 | |||
There was a problem hiding this comment.
This new expected value depends on background cleanup running within the 5-second wait in 02994_merge_tree_mutations_cleanup.sql.j2, but that test still uses default cleanup scheduling.
With defaults (cleanup_delay_period = 30 and cleanup_delay_period_random_add = 10), clearOldMutations is not guaranteed to run within 5 seconds, so this can become flaky (or fail) depending on timing.
Please set deterministic cleanup settings in the test table definitions (for example cleanup_delay_period = 1, cleanup_delay_period_random_add = 0, and optionally cleanup_thread_preferred_points_per_iteration = 0).
| DECLARE(UInt64, finished_mutations_to_keep, 100, R"( | ||
| How many records about mutations that are done to keep. If zero, then keep | ||
| all of them. | ||
| How many records about mutations that are done to keep. If zero, then no |
There was a problem hiding this comment.
This flips the meaning of finished_mutations_to_keep = 0 for existing deployments (from "keep all" to "keep none").
Because existing configurations can change behavior after upgrade, this looks backward-incompatible. Please consider using Backward Incompatible Change in PR metadata and adding explicit migration guidance in the changelog entry (how to preserve the previous keep-all behavior).
LLVM Coverage Report
Changed lines: 100.00% (13/13) · Uncovered code |
|
Dear @azat, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Previously, setting
finished_mutations_to_keepto 0 was interpreted as "keep all finished mutation entries" (the cleanup code returned early on the zero value). Flip the semantics so that 0 means "do not keep any finished mutation entry" - the natural reading of the setting name.