Skip to content

Backport #117034 to 26.6: Keep Distributed spool files after transient split errors - #118139

Merged
clickhouse-gh[bot] merged 3 commits into
26.6from
backport/26.6/117034
Sep 5, 2026
Merged

clickhouse-gh[bot] merged 3 commits into
26.6from
backport/26.6/117034

Conversation

@robot-clickhouse

@robot-clickhouse robot-clickhouse commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Original pull-request #117034

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.6.5.52

@robot-clickhouse robot-clickhouse added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix labels Sep 4, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [e6252db]

Summary: ✅

alexey-milovidov and others added 2 commits September 5, 2026 01:48
The old analyzer, which the 26.6 integration jobs still exercise, rejects a
non-trivial `ARRAY JOIN` expression without an alias with `ALIAS_REQUIRED`
(`No alias for non-trivial value in ARRAY JOIN`), so
`test_transient_error_after_sent_file_keeps_only_unsent_files` observed that
error instead of the expected `ARGUMENT_OUT_OF_BOUND` from `range`.

CI: https://github.com/ClickHouse/ClickHouse/pull/118139/checks

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 The two integration failures were the backport's own new test test_transient_error_after_sent_file_keeps_only_unsent_files: the old analyzer, still exercised by the 26.6 integration jobs, rejects the test materialized view's ARRAY JOIN range(if(value = 2, 2, 1)) without an alias (ALIAS_REQUIRED: No alias for non-trivial value in ARRAY JOIN), so the flush failed with that error instead of the expected ARGUMENT_OUT_OF_BOUND. Reproduced locally with enable_analyzer=0; giving the expression an alias (as r) fixes it under both analyzers. Also merged 26.6 into the branch. The same one-line alias could be applied on master for parity, although the test passes there.

Failure: https://github.com/ClickHouse/ClickHouse/actions/runs/33903780418/job/101127945498

@zlareb1

zlareb1 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Heads-up before merging: this backport also carries the regression tracked in #118153 — after #117034, DistributedAsyncInsertBatch::recoverBatch treats every file listed in current_batch.txt before a broken/ twin as already sent and deletes it, so a batch file that was never acknowledged by the remote shard is silently removed on recovery (repro matrix and pre-fix/post-fix comparison in #118153). The same combination already went out in #118141 to 26.8.

Suggest either waiting for the #118153 fix and backporting both together, or noting the known regression in the release notes for this branch.

@clickhouse-gh
clickhouse-gh Bot merged commit ab979c8 into 26.6 Sep 5, 2026
38 of 39 checks passed
@clickhouse-gh
clickhouse-gh Bot deleted the backport/26.6/117034 branch September 5, 2026 04:27
@zlareb1

zlareb1 commented Sep 5, 2026

Copy link
Copy Markdown
Member

This merged carrying the regression tracked in #118153 — the 26.6 branch now has it. At the merge commit ab979c8f4480, src/Storages/Distributed/DistributedAsyncInsertBatch.cpp still contains the reported shape: recoverBatch sets processed_files = i + 1 when a later file has a broken/ twin and then markAsSend-deletes the whole surviving prefix, destroying spool files that were never sent. The pre-fix on-disk states that trigger it are exactly what 26.6 servers have in their spool directories at the upgrade boundary, which is what this backport targets.

Please make sure the eventual fix for #118153 is also backported to 26.6, and consider holding #118138 (26.3) and #118140 (26.7) until it exists — 26.8 already picked this up unfixed via #118141.

@alexey-milovidov

Copy link
Copy Markdown
Member

🕵 Acknowledged. The fix for #118153 is #118211 (master). It is labelled pr-must-backport and pr-critical-bugfix, so once it merges the robot opens backports to every supported release branch, including 26.6 (this branch) and 26.8. The still open 26.3 backport #118138 already carries the same commit, so it does not ship the regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-critical-bugfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants