Repository navigation
Stable 25.3 Backport of #99628 - Fix TOCTOU race in vertical merge cancellation - #2817
Conversation
Fix TOCTOU race in vertical merge cancellation Conflicts committed as-is; the next commit resolves them: - src/Storages/MergeTree/MergeTask.cpp (both modified)
Kept the PR's latched `cancelled` variable in `executeImpl`, using the release branch's `ctx->is_cancelled()`.
|
Port-AL: cherry-pick conflicts resolved by AI Conflicted files:
Commits:
|
CI triage for #2817 (head
|
| Check | Classification | PR-caused? |
|---|---|---|
IntegrationTestsAnalyzerAsan / Integration tests (asan, old analyzer)-0 |
Infra: job SIGKILLed (exit 137) | No |
IntegrationTestsAnalyzerAsan / Integration tests (asan, old analyzer)-4 |
Infra: job SIGKILLed (exit 137) | No |
Grype Scan …/clickhouse-keeper (+ GrypeScan (keeper)) |
Pre-existing image CVEs | No |
DCO |
Pre-existing: backport commits have no Signed-off-by |
No (process) |
The workflow run 44384219738 is still in progress (GrypeScan (server, -alpine) is pending), so this can still change.
1. Integration tests (asan, old analyzer), shards 0 and 4: infra, safe to re-run
No test failed for good in either shard. Every test that failed on its first attempt passed when the runner retried it, and then the runner process itself was killed.
Shard 0 (job):
21:11:24 Tests with FAILED state (2): {'test_parallel_replicas_over_distributed/...[test_multiple_shards_multiple_replicas-4-1]', 'test_keeper_reconfig_remove_many/test.py::test_reconfig_remove_2_and_leader'}
21:12:20 Tests with PASSED state (2): {<the same two tests>}
...
21:13:51 [gw6] [ 31%] PASSED test_recompression_ttl/test.py::test_recompression_multiple_ttls
21:15:40 Killed
21:15:40 Run action failed for: [Integration tests (asan, old analyzer)] with exit code [137]
Shard 4 (job):
21:10:42 Tests with FAILED state (4): {'test_https_replication/test.py::test_replication_after_partition', ... test_both_https, test_both_http, test_mixed_protocol}
21:12:22 Tests with PASSED state (4): {<the same four tests>}
...
21:33:15 Killed
21:34:00 Run action failed for: [Integration tests (asan, old analyzer)] with exit code [137]
21:39:05 ... Killed pip install clickhouse-driver==0.2.8 numpy==1.26.4 pandas==2.0.3 jinja2==3.1.5
- In shard 4, a plain
pip installin the post-processing step was also killed. That points to the host (out of memory or the runner being reclaimed), not to ClickHouse or a test. - None of the retried tests touch vertical merges. The PR only changes
src/Storages/MergeTree/MergeTask.cpp(the stop/start-merges cancellation check) and adds the stateless test04041_vertical_merge_stop_start_race. - The sibling backport Stable 25.3 Backport of #89127 - Fix TTL merge bug #2884, which ran in the same time window, also has
Integration tests (asan, old analyzer)-4red. Stable 25.3 Backport of #127286 - Reject too deep cursors instead of exhausting the stack #2857 had all 8 shards green on the same base.
Next step: re-run the two failed jobs.
2. Grype Scan altinityinfra/clickhouse-keeper: pre-existing
Grype Scan Completed with 8 high/critical vulnerabilities. The already-merged #2857 on the same base reports exactly the same result for the keeper image (8 high/critical), and also for the -alpine server image. These CVEs come from the image and its dependencies. A one-function change in MergeTask.cpp can't add or remove them. They need fixing on the base branch's image, not in this PR.
3. DCO: pre-existing process issue
None of the 3 commits (486cbecb58 upstream merge, 168d5b0f99 conflict resolution, 5b9f7f98a4 base merge) has a Signed-off-by trailer. DCO also fails on #2884, #2858 and the merged #2857, so on this branch it doesn't block merging in practice. If you want it green, the commits would need a sign-off. That means rewriting history and force-pushing, which I'm not allowed to do, so it's up to you.
Summary: nothing here points at the backported fix. Re-run the two killed integration-test shards. Grype and DCO match the rest of the releases/25.3.14 backports.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix a rare logical error exception during vertical merge when
SYSTEM STOP MERGESandSYSTEM START MERGESare executed concurrently. (ClickHouse#99628 by @Daedalus-Icarus)Documentation entry for user-facing changes
...
CI/CD Options
Exclude tests:
Regression jobs to run: