Repository navigation
Avoid vertical TTL delete for TTLDrop merges - #108626
Conversation
|
@Avogar We discovered a more expensive form of the issue #105639, where large / wide parts trigger a Vertical merge which doesn't just read the first block from all streams, it reads all blocks. This is a much simpler patch than #105859 (which is great!), which moves from "all blocks" to "one block", and then your PR moves from "one block" to "zero blocks". Would you be willing to review and merge this as a first step, and can I ask that we backport this to stable and LTS releases since we're seeing some existing clusters degraded due to the current behavior? |
|
Git blame points to #97332 as the potential culprit, so this is present in 26.4 and later, but not 26.3 |
|
Workflow [PR], commit [ddd4b8a] Summary: ❌
AI ReviewSummaryThis PR forces Final Verdict✅ No new blocking findings. Residual risk is limited to performance evidence: the new test proves the observable contract ( LLVM Coverage ReportMeasured on commit ddd4b8a.
Changed lines: Changed C/C++ lines covered: 6/6 (100.00%) · Uncovered code |
8909d33 to
5cc5b80
Compare
TTLDrop merges with only an unconditional rows TTL know that all source rows are expired. The vertical TTL-delete path still scans key rows to write an all-skipped row-source file, which can make fully expired large parts expensive to drop. Use the existing horizontal TTLTransform all-data-dropped short-circuit for that case instead, while keeping vertical TTL delete enabled for partial and conditional TTL deletes. Add regression coverage that a background TTLDropMerge selected under vertical-merge thresholds uses the horizontal algorithm.
5cc5b80 to
3585ceb
Compare
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 5/5 (100.00%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 1 line(s) · Uncovered code |
|
Hi @EmeraldShift, I’m closing this PR as #105859 has been merged and provides a more efficient solution. Please feel free to share any further ideas or suggestions you may have! |
|
@copilot resolve the merge conflicts in this pull request. |
…rop-no-vertical Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…l the test on timeout canVerticalTTLDelete answers whether a TTL delete can run vertically; forcing a TTLDrop merge horizontal is an algorithm choice, so it now lives in chooseMergeAlgorithm, inside the need_remove_expired_values branch. A merge whose TTL removal was cancelled after selection may therefore still go vertical. 04411_ttl_drop_not_vertical polls part_log in a single loop and fails with an explicit error when the TTLDrop merge never shows up. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 24 s compile time in total, 7 of them have a recent master baseline. |
fbb92cb
Backport #108626 to 26.9: Avoid vertical TTL delete for TTLDrop merges
Backport #108626 to 26.8: Avoid vertical TTL delete for TTLDrop merges
Backport of the 03737 part of f432f74 (#105859). With #108626 a TTLDrop merge is always Horizontal, so a background TTLDrop merge that races OPTIMIZE FINAL flips test1_algo, and test2 (all rows expired) is a TTLDrop merge whose algorithm is no longer Vertical. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Backport of the 03737 part of f432f74 (#105859). With #108626 a TTLDrop merge is always Horizontal, so a background TTLDrop merge that races OPTIMIZE FINAL flips test1_algo, and test2 (all rows expired) is a TTLDrop merge whose algorithm is no longer Vertical. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Backport #108626 to 26.7: Avoid vertical TTL delete for TTLDrop merges
Backport #108626 to 26.3: Avoid vertical TTL delete for TTLDrop merges
TTLDrop merges know that all source rows are expired. The vertical TTL-delete path still scans key rows to write an all-skipped row-source file, which can make fully expired large parts very expensive to drop. Use the existing horizontal all-data-dropped short-circuit for this case instead.
I think this behavior is a bug, because it doesn't match the expected behavior of efficiently TTL dropping expired parts, especially with
ttl_only_drop_parts = 1. It would be nice to have this fix backported to recent stable releases, please.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed dropping whole parts with TTL (
ttl_only_drop_parts = 1) still reading all data from large, fully-expired parts.Workflow [PR]
Sync PR [sync-upstream/pr/108626]
Version info
26.10.1.562-master(included in26.10and later)26.9.2.25,26.8.11.30,26.7.14.36,26.3.33.142