Skip to content

Finish an interrupted mutation of a Join table when loading it - #119196

Closed
alexey-milovidov wants to merge 30 commits into
masterfrom
join-mutate-crash-atomic-116819
Closed

alexey-milovidov wants to merge 30 commits into
masterfrom
join-mutate-crash-atomic-116819

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

ALTER TABLE ... DELETE on a Join table was not crash-atomic. The mutation writes the rows it keeps into tmp/mut.bin, then unlinks every persisted .bin file, and only then renames the replacement into place. A server that died anywhere in between - a kill, an OOM, a crash; no power loss needed - left the table with whichever of the old files happened to survive, possibly none, while the replacement, staged in a directory StorageSetOrJoinBase::restore does not read, was ignored. The next start silently loaded that remainder: rows that had been acknowledged and that the DELETE never even matched were gone, with nothing in the log.

The swap is now committed before it starts. The mutation stages the replacement, then creates the marker tmp/mut.commit (by an atomic rename, so it is never seen half-written) holding the number the replacement is going to be persisted under, and only then publishes the new state in memory, removes the files numbered below it and renames the replacement into place. Up to the marker a failure leaves the table exactly as it was; from the marker on, the swap is finished either by the mutation itself or by restore at the next load, which performs the very same idempotent step (completeMutation). The replacement takes the next file number instead of 1, so inserts made after a committed-but-unfinished mutation are told apart from the files it replaces and are kept.

Three further holes found in review are closed as well: a mutation that failed after its commit left the marker pointing at tmp/mut.bin, which the next mutation reused for its own snapshot, so a load after a failure of that second mutation before its commit published the wrong file under the number of the first - a committed mutation is now finished before the next one stages anything; the marker used to be created after the in-memory publish, so an exception in between left the mutated rows in memory with the old files on disk, and the next insert reused a file number; and an insert that started before the ALTER used to publish its file with no coordination with the mutation, so its rows could be missing from the snapshot or loaded twice after a restart. The mutation now waits for the inserts that started before it to finish (bounded by lock_acquire_timeout) while holding the lock that prevents new ones from starting. That wait honours lock_acquire_timeout = 0 as "no timeout", the way every other lock in the server does, instead of giving up at once. Finishing a committed mutation is fail-closed: if its replacement is neither staged nor already in place, the load throws CORRUPTED_DATA and touches nothing, instead of clearing the marker and silently loading only what survived.

Verified with faults injected on both sides of the commit (storage_join_mutate_interrupt_before_commit and storage_join_mutate_interrupt_before_replacing_file): before the commit the table stays as it was and a following insert and reload keep all rows; after it the table reloads with the 50 rows the DELETE kept. A concurrent slow INSERT next to an ALTER TABLE ... DELETE yields the same rows in memory and after a reload. A committed-but-unfinished mutation followed by an INSERT keeps both the replacement and the newly inserted file after a reload, which is the interleaving that makes the increment + 1 numbering necessary.

Closes: #116819

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fixed silent data loss when a server died during ALTER TABLE ... DELETE on a Join table: the mutation replaced the table's persisted files in a window in which a crash left only a remainder of them, losing acknowledged rows the DELETE did not match. Such an interrupted mutation is now finished when the table is loaded, and a mutation waits for the inserts that started before it.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/119196]

A mutation replaces every persisted file of the table with one holding
the rows it kept, which takes more than one step: the old files are
unlinked and only then is the replacement, staged in a directory the
load does not read, renamed into place. A server that died in between
left the table with whichever old files happened to survive - possibly
none - and the staged replacement ignored, so acknowledged rows the
`DELETE` never matched were silently gone.

The mutation now marks that window with `tmp/mut.commit`, and the load
finishes what it finds: the replacement is put in place when it is still
staged, and the marker is cleared once it is.

Closes: #116819
@clickhouse-gh

clickhouse-gh Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [da4de25]

Summary: ✅


AI Review

Summary

This PR makes Join-table ALTER TABLE ... DELETE crash-atomic by staging the replacement, committing it with tmp/mut.commit, finishing interrupted swaps on load, and fencing already-started inserts before the mutation snapshots rows. I reviewed the current diff together with all prior PR discussion and did not find any remaining correctness, durability, or concurrency issue that still reproduces in the current code.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Sep 10, 2026
Comment thread src/Storages/StorageJoin.cpp Resolved
Comment thread src/Storages/StorageJoin.cpp Resolved
@clickhouse-gh clickhouse-gh Bot added the comp-simple-engines Lightweight single-node table engines: Log/StripeLog (append-only logs), Buffer (async batching),... label Sep 10, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Commit da4de25fd62b226f1db9805bee11da245e87335b was not compared: the CI logs cluster did not answer (every POST attempt failed with an exception).

See the job log for details.

alexey-milovidov and others added 2 commits September 17, 2026 17:08
… the inserts that started before it

Address the two review findings on the recovery of an interrupted mutation.

The commit marker was created after the new state had been published in
memory and `increment` had been reset, so a failure in between - flushing
the replacement, writing the marker - left the server running with the
mutated rows in memory and the old files on disk, and the next insert
reused the number of one of those files. The marker is now created,
by an atomic rename so it is never seen half-written, before anything is
published or removed: up to that point a failure leaves the table as it
was. The replacement also takes the next file number instead of `1`, and
the marker records it, so `completeMutation` - the swap itself, shared
by the mutation and by the load after an interruption - removes only the
files numbered below it and keeps the inserts made after the commit.

An insert is assigned its file when it starts and publishes it on its
own later, with no coordination with a mutation that ran in between: its
rows could be missing from the snapshot the mutation took, or its file
loaded next to the replacement after a restart. The sinks are now
counted, and `StorageJoin::mutate` waits, while holding the lock that
stops new ones from being created, for the outstanding ones to finish
before it snapshots the rows.

Tests: `05227_join_mutate_crash_atomic` (renumbered from 05189, which
master took) covers a failure before the commit followed by an insert and
a reload, and the interrupted swap; `05228_join_mutate_concurrent_insert`
runs an insert whose rows arrive slowly next to an `ALTER TABLE ... DELETE`
and checks the table in memory and after a reload. The test no longer
uses `find -printf`, which is not available on macOS:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=39de303a709e470993527d070a0e8d1e8bc0874b&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29

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

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=39de303a709e470993527d070a0e8d1e8bc0874b&name_0=PR&name_1=Stress%20test%20%28arm_release%29 (Logical error: PartsSplitter expected unique range) and provide a fix in a separate PR. If the fix is already in progress, link it here. It looks like the case #119295 addresses; this PR only touches the Join table engine.

@clickhouse-gh clickhouse-gh Bot added pr-critical-bugfix pr-must-backport Pull request should be backported intentionally. Use this label with great care! and removed pr-bugfix Pull request with bugfix, not backported by default labels Sep 17, 2026
@groeneai

Copy link
Copy Markdown
Collaborator

Investigated: your PR is a bystander. The abort comes from the stress lane's server-side AST fuzzer, and the stack ends in executeASTFuzzerQueries; nothing Join-related is on it.

From that run's artifacts: 05104_s3_plain_rewritable_hard_links creates reader (key Int32, renamed UInt32) ENGINE = MergeTree ORDER BY key SETTINGS table_disk = 1, disk = disk(..., type = s3_plain_rewritable), and the fuzzer clones it with the same columns and the key direction flipped:

CREATE TABLE test_a6v7v0v7s1m4.reader__fuzz_1 (`key` Int32, `renamed` UInt32)
ENGINE = MergeTree ORDER BY key DESC
SETTINGS table_disk = 1, disk = disk(name = '05104_s3_plain_rewritable_hard_links_test_a6v7v0v7s1m4_reader', type = s3_plain_rewritable, ...)

table_disk = 1 mounts the parts already present at that root, and they were written ascending, so SELECT count(), sum(key), sum(renamed) FROM reader__fuzz_1 (query_id 5c4c472b-15c3-4a03-9b79-10799b1f79f2, aborted at 16:23:41) reads an ascending primary index in the declared descending order. Every range's RangeEnd then sorts before its own RangeStart, and splitPartsRangesImpl hits a duplicate PartRangeIndex at PartsSplitter.cpp:547.

Your reading is right, and the fix is already open: #119295 compares the two index values where that loop already has both, and reports INCORRECT_DATA naming the offending part instead of LOGICAL_ERROR. @ PedroTadim asked for it in place of the fuzzer-side strip he closed (#119159). It has had no review since it was opened on Sep 10, and he left the choice of approach to @ jkartseva.

The same state reached master itself once (Stress test (arm_release) on 27ee4ee), and the debug-build sibling chassert at :530 had 16 CIDB rows across 13 PRs in the 30 days to Sep 10, so this is a trunk state rather than a property of your branch.

clang-tidy rejects the uninitialized declaration.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread src/Storages/StorageJoin.cpp Resolved
…ronize the concurrent insert test

`StorageJoin::truncate` used to reset `increment` to `0`. The numbering a mutation relies on to tell
the files it replaces from the inserts made after it was committed (see `completeMutation`) is easier
to reason about when the numbers never restart, so `truncate` now keeps `increment` as it is: the
files are removed anyway, and a number is never reused over the lifetime of the table.

`05228_join_mutate_concurrent_insert` waited for a fixed `sleep 0.5` before issuing the
`ALTER TABLE ... DELETE`, so on a loaded machine the `ALTER` could win the race, the row count would
still match, and a regression in `waitForOutstandingSinks` would stay green. It now waits until the
insert has read a row, which proves its sink already exists, because the sink is created while the
pipeline is built.

Added `05231_join_mutate_after_truncate`, pinning that a mutation and a reload after a `TRUNCATE`
keep the rows of the inserts around it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Comment thread src/Storages/StorageJoin.cpp Resolved
alexey-milovidov and others added 2 commits September 20, 2026 00:27
…the next one stages its replacement

A mutation that threw inside `completeMutation` after `commitMutation` left the table
in the mutated state in memory, while the only durable copy of that state was the
replacement staged in `tmp/mut.bin` with the marker `tmp/mut.commit` pointing at it.
The next `ALTER TABLE ... DELETE` overwrote `tmp/mut.bin` with its own snapshot, and
if it failed before its own commit, the load published that snapshot - or whatever
part of it was written - under the number of the first mutation, losing the rows the
uncommitted mutation had deleted.

`StorageJoin::mutate` now calls `finishInterruptedMutation` before it opens
`tmp/mut.bin`, so the marker never points at a file staged by a later mutation.
New test `05233_join_mutate_after_unfinished_mutation` injects
`storage_join_mutate_interrupt_before_replacing_file` into the first mutation and
`storage_join_mutate_interrupt_before_commit` into the second, reloads the table, and
checks that the rows the committed mutation kept are the ones recovered.

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

Copy link
Copy Markdown
Member Author

🕵 @groeneai, the only red on this PR is Build profile diff: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=024ff68f197e03ead7e0db227a85b9846ae70114&name_0=PR&name_1=Build%20profile%20diff — it fails with RuntimeError: CI logs cluster query failed out of compare_opt_functions, i.e. the shared CI logs cluster did not answer the read. It measured nothing about this change; this PR only touches the Join table engine and its tests.

The fix is already in progress, no separate PR is needed:

Comment thread src/Storages/StorageSet.cpp Resolved
alexey-milovidov and others added 2 commits September 20, 2026 20:37
…ing for outstanding sinks

`waitForOutstandingSinks` fed the raw `lock_acquire_timeout` into
`condition_variable::wait_for`, where zero returns immediately. Zero means "no
timeout" everywhere else in the locking code - see `RWLockImpl::getLock`, which
turns it into an infinite deadline - so an `ALTER TABLE ... DELETE` on a `Join`
table threw `DEADLOCK_AVOIDED` as soon as it saw a running insert under a
setting that is supposed to disable the timeout. Zero now waits indefinitely,
and the bounded `wait_for` path is kept for positive timeouts.

New test `05234_join_mutate_lock_acquire_timeout_zero`: the mutation runs with
`lock_acquire_timeout = 0` against an insert that is already producing rows, and
has to wait it out. Control-proved with a binary built without the fix: it fails
in 0.07 s with `DEADLOCK_AVOIDED`, while with the fix it takes ~2 s and both the
in-memory and the reloaded table hold all 55 rows.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=08aeab83f6bc7a7ebf2e25fa24c2ef916b851ec9&name_0=PR&name_1=Performance%20Comparison%20%28arm_release%2C%20master_head%2C%202%2F6%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.

The shard reports 3 too long, 6 slower, 4 unstable; 1 confirmed regression(s), with timeseries_to_grid_aggregation_functions #8 as the confirmed one. This is not caused by this PR, and it looks like a noisy test rather than a real regression:

  1. This PR cannot reach those queries. It only touches StorageJoin, StorageSet, FailPoint and five new stateless tests. None of timeSeriesInstantRateToGrid, timeSeriesInstantDeltaToGrid, timeSeriesChangesToGrid, timeSeriesResetsToGrid, timeSeriesDeltaToGrid, timeSeriesPredictLinearToGrid, nor the minmax index scan in index_bulk_filtering #2, goes through the Join table engine.

  2. Every 'slower' timing on this PR is inside master's own range over the last 10 days on %Performance%arm%master_head%:

query this PR master p50 master max
timeseries_to_grid_aggregation_functions #4 125.1 ms 82 ms 134 ms
timeseries_to_grid_aggregation_functions #8 122.0 ms ~84 ms 131 ms
timeseries_to_grid_aggregation_functions #10 180.8 ms ~135 ms 189 ms
timeseries_to_grid_aggregation_functions #13 171.7 ms 133 ms 186 ms
timeseries_to_grid_aggregation_functions #20 256.5 ms 225 ms 278 ms
timeseries_to_grid_aggregation_functions #24 309.1 ms 266 ms 321 ms
index_bulk_filtering #2 70.7 ms ~65 ms 78 ms

So the PR side measured nothing unusual; the comparison went red because the reference side of that particular shard run came out unusually fast.

  1. It is fleet-wide. Over the last two days, timeseries_to_grid_aggregation_functions queries were flagged slower/FAIL on the arm performance lane for ~25 different pull requests — and 22 times on master itself (pull_request_number = 0), where there is no change at all to attribute them to.

I could not find an existing open issue for the instability of this test, so one probably needs to be created.

The other red, Build profile diff, is the CI-logs-cluster outage already reported above:

Comment thread src/Storages/StorageJoin.cpp Resolved
@groeneai

Copy link
Copy Markdown
Collaborator

Agreed on all three points, and the shard's own artifacts say why it went red. The run lost the learned per-query thresholds and then judged every query against the bare 0.15 floor.

job.log has three Read timed out. (read timeout=10) against play.clickhouse.com at 01:04:52, 01:05:02 and 01:05:12, then WARNING: Failed to fetch historical thresholds, will proceed without them and an empty historical-thresholds.tsv. The consequence is visible in all-query-metrics.tsv: all 172487 rows carry the same (changed_threshold, unstable_threshold) pair, (0.15, 0.25).

Against the bars this test's own history gives it (GET_HISTORICAL_TRESHOLDS_QUERY, i.e. ceil(1.5 * p99(abs(diff)), 2) over master runs one to five weeks back), not one of the six slower rows crosses:

query measured bar used its own bar
#4 0.602 0.15 0.77 *
#8 0.590 0.15 0.91
#10 0.433 0.15 0.60
#13 0.364 0.15 0.53
#20 0.184 0.15 0.45
#24 0.188 0.15 0.34

Those bars sitting at 0.3 to 1.2 are the quantitative form of your point 3. query_metrics_v2 for #8 on arm master over the last 10 days (108 runs) gives diff p50 -0.005, p95 +0.383, max +0.704, so the +0.590 here is a value master produces on its own. This PR shows it too: same test, same instance type, mean diff -0.094 with 1 of 10 queries slower on 024ff68f197e, and +0.248 with 8 of 10 on 08aeab83f6bc. Across 327 arm master runs of the test the per-run mean diff spans -0.114 (p05) to +0.164 (p95), and 26 runs had every query slower while 37 had every query faster, which is a whole-run offset rather than per-query noise.

Why the fetch fails at all: that threshold query takes 9.0 to 9.6 s (three measurements just now) against the hardcoded 10 s timeout, retried three times at the same 10 s.

The fix is in progress and needs both of my open pull requests:

Neither alone clears this shard. With the floors in place the report does publish #8 as slower (0.590 against its 0.587 stat threshold), so #121090 alone leaves the confirmed_regression blocking; and #121189 alone leaves the dashboard verdict as the sole judge, which blocks whatever the report says. With the bars restored #8 is not a published slowdown, so the gate has nothing to act on.

* One gap I found while checking this: the learned row is joined on query_display_name, and #4's historical name is timeSeriesInstantRateToGrid(0, 100000, 10, 160) while the fixture now generates ..., 80). So #4 keeps the floor even after the fetch is fixed. That leaves one slower row, far below the 10-query floor, and the shard is green either way.

On the issue: I would rather not open one against the test, because its spread is already bounded by the learned bars and only reaches the check when those are missing, which is what the two PRs above fix. If you want a standalone issue for the fixture's own spread anyway, say so and I will open it.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The only red on 9eb1ce97, Stress test (arm_release) Segmentation fault (STID: 2658-4e66) in StorageDistributed::read under a CHECK constraint's scalar subquery, is unrelated to this PR. It hit 6 PRs between 2026-09-22 and 2026-09-23 and was fixed by #121418 (merged 2026-09-24); there have been no occurrences since. Merged master as a4bcaf4d9472 (clean) to pull in the fix; the three affected objects rebuild clean.

Comment thread src/Storages/StorageSet.cpp Resolved
…itForOutstandingSinks`

`lock_acquire_timeout` is user-controlled, and `condition_variable::wait_for` converts the
duration to nanoseconds, which overflows for huge values. Clamp it with `saturatedMilliseconds`
like the other `wait_for` paths do. New test `05261_join_mutate_lock_acquire_timeout_huge`
runs `ALTER TABLE ... DELETE` with `lock_acquire_timeout = 1000000000000` against an in-flight insert.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Comment thread src/Storages/StorageSet.cpp Resolved
alexey-milovidov and others added 3 commits September 28, 2026 03:26
…eloads

A mutation that deletes every row writes a zero-length replacement, which
`restore` skips like any empty file. Finishing such a committed mutation on
load must accept it and keep the files of later inserts, both when the
replacement is still staged in `tmp/mut.bin` and when it is already in place.
This pins the behaviour against rejecting zero-length replacements in
`completeMutation`, which would refuse to load a valid table.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…tomic-116819

# Conflicts:
#	src/Storages/StorageSet.cpp
…he Join mutation tests

Since #119572 (#119572), `clickhouse-local --ignore-error`
reports execution errors on stderr, so the fail-point errors of the five Join mutation tests made
`Fast test` red ("having stderror"). Redirect stderr of those runs to a file and print the count of
`FAULT_INJECTED` errors, which also proves the injected failures happened.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=119196&sha=b253202e872a1f42851bbb312007c0e8e33040ae&name_0=PR&name_1=Fast%20test
PR: #119196

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Merged master as f0948ca1ef7. All reds on 63afb61dce6 are unrelated to this PR (none touch Join/Set storage):

@groeneai, investigate the 05237_with_expression_alias_scope_descendant failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=63afb61dce6a74c3b96963e7a0922a3fe775a056&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20s3%20storage%2C%20DBReplicated%2C%20parallel%2C%201%2F2%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.

@groeneai

groeneai commented Oct 4, 2026

Copy link
Copy Markdown
Collaborator

The fix is in progress: #123790 (it includes the change from my #123774, closed in its favor).

The failure on 63afb61dce6 has the same diff as on the other PRs: the DatabaseReplicated DDL path qualified nested, an alias declared inside the WITH expression, with the database, so the view read the table nested (10) instead of the alias (100).

It is deterministic under DatabaseReplicated, not flaky. The 66 reruns pass because the diagnostics rerun in ci/jobs/functional_tests.py builds its clickhouse-test command from a fixed flag list without --replicated-database, so it runs in a plain database. My open #112247 forwards the job's runner options to that rerun.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Thank you, @groeneai. So the 05237_with_expression_alias_scope_descendant red is tracked by #123790: the DatabaseReplicated DDL path qualifies the WITH-scoped alias nested with the database name. It has nothing to do with this PR. #112247 (forwarding --replicated-database to the diagnostics rerun) should also stop such reds from being mislabelled as flaky. CI on the current head f0948ca1ef7 is still running, with no failures so far.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CI on f0948ca1ef7 was green apart from the pending CH Inc sync. The 4 failures in Bugfix validation are the expected xfail results: the new tests fail on master. The branch was more than a week behind, so I merged master as 5fb2c683765. The merge was clean. Upstream touched StorageJoin.cpp, StorageSet.cpp and FailPoint.cpp, but only with the mechanical addBlockToJoin / SecretArgumentsSpec API changes and new fail points, nothing that overlaps this PR's logic. The merged tree builds, and all 9 tests of this PR pass locally. The previous comment from @groeneai (the 05237 red is tracked by #123790) was already acknowledged above. There are no unresolved review threads.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The AST fuzzer (amd_debug, targeted, old_compatibility) failure (Logical error: 'Cannot call function and because is has 3 arguments but 2 columns were captured.' on a system.columns query, report) is unrelated to this PR: it is a master regression from #125033 in pruning by virtual columns, and the fix is in progress in #125126.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Merged master as dd9641944ae; the merge is clean, clickhouse builds, and all eight tests of this PR pass locally.

The only red on 5fb2c683765 is unrelated: AST fuzzer (amd_debug, targeted, old_compatibility) hit Logical error: Cannot call function and because is has 3 arguments but 2 columns were captured (STID 2458-4cb4) on a system.columns query with an and over database/table filters - nothing in Join/Set storage. It is a master regression from #125033, and the fix is in progress in #125126 (rebuild a reduced and when pruning by virtual columns).

Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=5fb2c6837652fb109051a414d86b9a96d6f27ce8&name_0=PR&name_1=AST%20fuzzer%20%28amd_debug%2C%20targeted%2C%20old_compatibility%29

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The only CI failure on dd9641944ae was test_database_disk/test.py::test_copy_of_temporary_table_under_unrelated_name in Integration tests (arm_binary, 2/4). It is not related to this PR. Master already fixed the test in 3e84b0917b4 ("Fix test_copy_of_temporary_table_under_unrelated_name after #123902"), so I merged master as b930052b48d. The merge was clean and did not touch the PR files. StorageJoin.cpp, StorageSet.cpp and FailPoint.cpp still build. There are no unresolved review threads.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Merged master as 9136972edad; the merge is clean, clickhouse builds, and all nine tests of this PR pass locally.

The only red on b930052b48d is unrelated: 05210_lightweight_update_materialized_cte_in_ignore in Stateless tests (arm_binary, ParallelReplicas, s3 storage, parallel) failed with UNKNOWN_TABLE for _materialized_cte_c_* — a materialized CTE referenced twice is forwarded to parallel replicas under the initiator's temporary table name. This is #112642, with a fix in progress in #123121 (it is not on master yet). Report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=119196&sha=b930052b48dba5f7c62fac0e2c6ec85df7a6fa84&name_0=PR&name_1=Stateless%20tests%20(arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel)

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Merged master as da4de25fd62; the merge is clean, clickhouse builds, and all nine tests of this PR pass locally.

CI on 9136972edad: the 4 failures in Bugfix validation are the expected xfail rows (those tests pass on master; the job itself succeeded because the other tests reproduce the bug). The only red check was CH Inc sync (build failed): in the sync PR only Build (amd_msan) failed, after 211 s on an ARM runner pool, while Build (arm_msan) and all other builds passed. That looks like an infrastructure failure, not a compile error caused by this PR. This push triggers a fresh sync run.

@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CH Inc sync on da4de25fd62 reports build failed. The only failed build in the sync PR is Build (amd_msan). It failed in Build ClickHouse after 216 s on a private-arm-large runner. All other private builds were reused, and the public Build (amd_msan) of the same commit succeeded. The sync merge resolved the private setJoin accessor correctly. A syntax-only compile of the merged private StorageSet.cpp, StorageJoin.cpp and the private-only StorageSharedSetJoin.cpp (the only private code built on StorageSetOrJoinBase) passes with no errors. So this looks like an infrastructure failure of that job, not a build break caused by this PR. I cannot rerun checks of the clickhouse-cloud-ci app from this account, so the job needs a rerun on the private side. The rest of the public CI on da4de25fd62 is still running.

@alexey-milovidov alexey-milovidov removed pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-critical-bugfix labels Oct 21, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

See #116819 (comment)

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

Labels

comp-simple-engines Lightweight single-node table engines: Log/StripeLog (append-only logs), Buffer (async batching),...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ALTER TABLE ... DELETE on a Join-engine table is not crash-atomic: a server kill during the mutation silently loses acked rows the DELETE never matched

2 participants