25.8 Stable backport of #91574: Add cleanup thread to MergeTree to avoid cleanup starvation - #1589
Conversation
6dfbdcc to
20c0341
Compare
fbb3c2e to
d4b049c
Compare
…-thread Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
d4b049c to
f67d3b3
Compare
Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
f67d3b3 to
9f01fd8
Compare
Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
…ases/25.8.16/91574_new
Review notes
In upstream the equivalent change is done by ea67e82 from ClickHouse#87719 , but it is not directly applicable to 25.8
Fixes fluky check. Actually not related to the backport: if test files are altered artificially, e.g. via adding fake comments, we have same issue.
Some good test fixes
The trickiest change. Fixes failures in e.g. 03174_exact_rows_before_aggregation.
Some required test fixes
Actual backport with some rather significant changes. In particular in ReplicatedMergeTreeCleanupThread area, e.g. NodeCacheEntry. |
|
Same test failures are observed in #1817 , although there were no failures before rebase. |
|
Overall LGTM! Please fix the comments I left on the backport commit and I'll approve :) |
Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
|
AI audit note: This review comment was generated by AI (gpt-5.3-codex). Audit update for PR #1589 (cleanup-thread backport for Confirmed defects
Coverage summary
|
|
Both mentioned defects seem
So,
Presumably I don't think that we have anything to do here. |
✅ QA Verification: PASS — no regression attributable to this PRBackport of upstream #91574 (MergeTree dedicated cleanup thread) to Functional verification (manual, PR release binary):
Added/edited tests — all passing:
Diff-check vs upstream ClickHouse#91574:
CI failure triage:
Build (amd_release): In the analyzed run it failed because it used the wrong runner. #2026 fixed the runner for release build jobs; the latest run includes that fix and the release build passes. This build feeds only packaging/compat/docker jobs — no stateless/integration/regression test depends on it, so it did not affect functional coverage. VerdictNo regression introduced. The fix works and is controllable, shutdown is clean, all new/edited tests pass across build types (incl. sanitizers), and all CI failures are either an already-fixed upstream issue or pre-existing flaky/broken tests. Approved from QA side. |
|
Antalya 25.8 is covered in #2059 |
This is just a try to backport this PR.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Add a dedicated cleanup thread for MergeTree to prevent cleanup delays under heavy merge load. This resolves ClickHouse#86181.
The MergeTree cleanup logic was tightly coupled with the merge scheduler, which caused cleanup tasks to be delayed or completely blocked when the table was under heavy merge load. ReplicatedMergeTree already had a separate cleanup thread, so this change aligns MergeTree with that design.
(ClickHouse#91574 by amosbird)
CI/CD Options
Exclude tests:
Regression jobs to run: