Repository navigation
Say whether a failed CAS ref-log commit can still take effect - #2577
Conversation
publishCkpt labelled every non-fence give-up (policy deadline, lease deadline, unresolved) as persistent CAS contention. Route them through orThrow, which names the actual reason. Error code and class unchanged. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ref-log commit errors reported "could not be committed; retrying later" even when the transaction was already durable (only the `_ckpt` frontier publish failed) or its outcome was unknown. Name the outcome in the message: durable, unknown, or not durable. The original cause stays inside the text. Error codes and behaviour are unchanged. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
`orThrow` rendered every `Unresolved` give-up as "sent". A failed initial observation gives up unresolved before any request is sent. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Construct the outcome exception after the lane transition or `requireRecovery`, since building it can throw. The durable text now covers all three durable sites (frontier publish, mount fence, install admission) and embeds the cause without extra info or version. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflict in docs/en/antalya/cas/operations/troubleshooting.md: took the base's updated throttling row and kept this branch's commit-error row. Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR #2577 CI VerificationVerdictNo regression. CI does not block approval. The head changes exception text in the CAS ref-log and checkpoint paths. Error codes stay Eight jobs are red on the head. Two of those reds are a single crash and a single failed restart, each with one cascade row beside it. Everything else is an Alpine CVE scan, an S3 timeout before the fuzzer started, or a test that already fails on other pull requests.
The How the list was reduced
The earlier commit Findings
|
| Who | Runs | Fails | Rate |
|---|---|---|---|
| Other PRs, this job | 310 | 4 | 1.3% |
antalya-26.6 branch runs, this job |
23 | 0 | 0% |
| PR 2577 | 1 | 1 | one run |
Across every check, the branch is 0 fails in 562 runs of this test over 60 days, and other pull requests are 7 fails in 3,411 runs. One failure on one run is what a 1.3% job rate produces. The in-job diagnosis reran the query 73 times without the randomized settings and it passed. The MergeTree settings it then blamed do not match a single deterministic failure of the new commit text.
Stateless tests (amd_debug, parallel) — pre-existing-flaky
One debug abort:
Logical error: 'GroupingAggregatedTransform pushed bucket 5 twice'
DB::GroupingAggregatedTransform::pushData
src/Processors/Transforms/MergingAggregatedMemoryEfficientTransform.cpp:63
Server died in the same job is the harness record of that abort.
The assertion is not in the diff. On this job, over 60 days:
| Who | Commits | Commits with this abort |
|---|---|---|
| Other PRs | 621 | 11 (1.8%) |
antalya-26.6 branch |
18 | 0 |
| PR 2577 | 2 | 1 (the head only) |
3e9e12db ran this job and did not abort. The same assertion shows up through October on unrelated pull requests (2420, 2499, 2559, 2318, 2570, and others) and on branch runs of other stateless jobs. GitHub's test summary for this job is Failed: 0, Passed: 9200. The job is red because of the fatal, not because a named stateless test failed.
Stress test (amd_debug) — pre-existing-flaky
Cannot start clickhouse-server. On restart the server cannot attach leftover metadata:
Table test_3.test_hybrid_alias_predicate_left does not exist.
Cannot attach table test_3.test_hybrid_alias_predicate ... ENGINE = Hybrid(...)
(UNKNOWN_TABLE)
Check failed is that process exiting 1. fatal.log is not the story. The server never finished loading metadata.
Cannot start clickhouse-server on this job, 90 days, counted by commit:
| Who | Commits | Cannot-start commits |
|---|---|---|
| Other PRs | 765 | 35 (4.6%) |
antalya-26.6 branch |
37 | 2 (5.4%) |
| PR 2577 | 1 | 1 |
UNKNOWN_TABLE during that restart appears on 11 other pull requests. The table name test_hybrid_alias_predicate appears only in this run. The diff does not touch Hybrid or table loading. One stress run against a 5% cannot-start rate is the baseline, not a new failure mode.
Unit tests (asan_ubsan) — pre-existing-flaky
IcebergMetadataGenerator.ModifyColumnAfterItselfWithoutTypeIsNoop fails with:
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /ClickHouse/src/DataTypes/IDataType.h:380:67
Both commits on this PR failed this way (3e9e12db and the head). The sanitizer report is in IDataType.h. This PR does not touch that file or Iceberg.
| Who | Runs | Fails | Rate |
|---|---|---|---|
| Other PRs | 176 | 37 | 21% |
| Branch, this job | 13 | 1 | 7.7% |
| PR 2577 | 2 | 2 | two runs |
The same IDataType.h:380 line is in 70 other-PR hits across 19 pull requests. Two failures in two runs sits above 21%, and two runs is not a rate. The stack is outside the diff, and the test already fails on the branch.
RegressionTestsRelease / Swarms / swarms — pre-existing-flaky
The report is 1,031 scenarios, 1,017 ok, 14 skipped, and one errored feature. No scenario is Fail. The error is in the TestFlows suite, at swarms/tests/feature.py:
TypeError: name must be specified
/swarms and /swarms/feature are that same traceback. Over 60 days the database has 24 name must be specified errors on these two nodes, spread from the week of 2026-09-06 through 2026-10-18, on commits other than this PR. One of the 24 is this run. The ClickHouse diff does not touch the swarms suite.
Grype — pre-existing-flaky
Both scans fail on Alpine distro advisories, severity High. The keeper image (Alpine 3.21) has four: CVE-2026-84782, CVE-2026-84784, CVE-2026-85091, CVE-2026-72897. The Alpine server image (Alpine 3.24) has one: CVE-2026-85091. The finding ids are alpine:distro:alpine, not a library compiled from this diff. The diff does not change a Dockerfile, a package list, or an image base. A rerun scans the same base and fails the same way.
Recommendation
Approve on CI grounds.
Rerun AST fuzzer (amd_debug, targeted) if you want that box green. A rerun can also clear 04023, the debug abort, and the stress restart, because those fail on a few percent of commits. It will not clear Grype, and the asan unit test fails on about one in five other-PR runs, so it may stay red. None of those should block this PR.
PR #2577 Audit ReviewVerdictNo High or Medium defect. The three new phrases match the lane transitions they are attached to. Two Low gaps. A write that arrives while the lane is already wedged or in recovery does not carry the earlier transaction's phrase, despite what the new guide says. And one phrase covers both a promote that can come back after restart and a precommit that never publishes the part. What the change doesA failed ref-log commit used to be one
Model
The central argument, and why it holdsThe phrases are claims about the ref-log transaction, and each one is attached to the transition that makes the claim true.
The frontier block is reached only after the log object is durable (this attempt committed, or the conflict occupant was this attempt's own bytes).
The gtests pin the phrases to those arms ( FindingsObservability and diagnosabilityLow: a write queued behind a wedge does not carry the earlier transaction's phrase.
Low: one phrase covers a promote that can return and a precommit that cannot.
A third durable exit uses yet another sentence. If the frontier was published and this process's table changed before install, the waiter gets Coverage
Assumptions: static reading of head Operational readinessScope. A failed Issues1. The retry does not repeat the first error's phrase
2. With dedup on, a retry can report success and write nothing
3. The durable phrase does not say whether rows can come back
Readiness verdictUsable for the first error, with two operator rules. Read the phrase on that first error, and do not treat a later Operator guidanceOn Recommended fixes
|
A write queued behind a wedged or recovering ref lane now names the earlier transaction's outcome with the same phrase the original writer saw. A precommit that is durable but unacknowledged says its part is never published, apart from the promote case. The troubleshooting guide rows match. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Mikhail Filimonov <[email protected]>
The conclusive-rejection and foreign-interference wedge errors now state the earlier transaction's outcome; wedge texts say the blocked write was not attempted; the promote note appears only for promote items. The guide names the errors that carry no phrase and the referent of "retry". Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Mikhail Filimonov <[email protected]>
The guide lists phrase-less errors as examples of errors that name no earlier transaction. The foreign-interference message now says the lane is faulted, which is its real state. The durable-unconfirmed test checks a non-promote item omits the promote note. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Mikhail Filimonov <[email protected]>
|
Thanks for the audit. Fixed in 2643bcd, 5f137d9 and 02a2511:
|
| else | ||
| { | ||
| const std::string_view promote_note = item->kind == RootMutationKind::Promote | ||
| ? " (a promoted part returns after a restart that precedes part cleanup)" : ""; |
There was a problem hiding this comment.
There is an edge case where this message is incorrect - insert into ReplicatedMergeTree.
- we enter to
commitPart. - transaction.renameParts calls the storage's commitTransaction. The CAS promotion becomes durable, but checkpoint publication fails.
- This message promise
promoted part returns after a restart. - But part isn't published in Keeper:
zookeeper->tryMultiNoThrowis the next step, and we never reach it - After a restart, the part is unexpected and may be moved to detached instead of becoming active. Its rows do not automatically become visible.
There was a problem hiding this comment.
Confirmed, and it reaches one step further than the detach. MergeTreeData::Transaction::renameParts makes the part durable before the Keeper multi, so when the _ckpt publish throws there the part never gets a Keeper entry, and StorageReplicatedMergeTree::checkParts moves every unexpected part to detached/ignored_<part> at the next start. No rows come back. The block id never reached Keeper either, so a retry is not deduplicated; a second copy appears only if someone attaches the ignored part by hand.
The ref ledger cannot see the engine, so 74562b9 drops the engine claim from the message: it now says only that the write may take effect and a retry may duplicate it. The troubleshooting guide (#cas-commit-errors) and the C10 row in part-lifecycle.md say what each engine does. The behaviour itself (rolling back a part whose promote is durable) is a separate fix, tracked for both engines.
…-26.6/cas-commit-outcome-texts Signed-off-by: Mikhail Filimonov <[email protected]> # Conflicts: # docs/en/antalya/cas/operations/troubleshooting.md
The text said a promoted part returns after a restart that precedes part cleanup. That holds for `MergeTree` only. `ReplicatedMergeTree` makes the part durable in `MergeTreeData::Transaction::renameParts` before the Keeper multi, so when the `_ckpt` publish throws there the part never reaches Keeper, and `StorageReplicatedMergeTree::checkParts` moves it to `detached/ignored_<part>` at the next start: no rows, and a retry is not deduplicated. The ref ledger cannot see the engine, so the message now claims only that the write may take effect; the guide and the C10 row say what each engine does. Review: #2577 (comment) Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Mikhail Filimonov <[email protected]>
#2577, merged into antalya-26.6 as ae6e749. Conflict in src/Disks/tests/gtest_cas_ref_wedge_every_attempt.cpp: keep the 26.8 ProfileEvents counter reads without .load(), take the new expectThrowsCodeWithMessage assertions. (cherry picked from commit ae6e749) Signed-off-by: Mikhail Filimonov <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]>
CAS ref-log commit errors said "could not be committed; retrying later" even when the transaction was already durable (only the
_ckptfrontier publish failed) or its outcome was unknown. The messages now say which of three outcomes applies, so a client can tell whether a retry may duplicate the write.Texts only: behaviour is unchanged, and so are error codes for
DB::Exception; a non-DBexception from the store surfaces as aDB::Exceptioncarrying its message. The original error is kept inside the new message. The originalCAS write could not be committedlog line from the inner throw may still appear in the server log next to the client's message.A write queued behind a wedged or recovering ref lane was never attempted; its message now names the earlier transaction's outcome with the same phrase. A precommit that is durable but unacknowledged now says its part is never published; a promote keeps the "may still take effect" text. Errors that name no earlier transaction (for example an admission refusal before the write is queued, a failed table recovery, a lost lease, a self-remount supersession, a terminal lane state) carry no phrase, and the guide says so.
Also,
publishCkptnow reports the real give-up reason (policy deadline, lease deadline, unresolved) instead of "persistent CAS contention".Related: #2343
Risks / notes
non_replicated_deduplication_windowafter a durable-but-unacknowledged precommit is skipped as a duplicate and its rows are lost; the guide says so. Recording the block id in the same ref-log transaction is a separate change.ReplicatedMergeTreemakes the part durable before the Keeper multi, so a promote whose_ckptpublish failed never reaches Keeper and is detached asignored_<part>at the next start; a retry is then not deduplicated. The message stays engine-neutral; the guide and the C10 row say what each engine does.Testing
DurableUnconfirmedTextNamesPrecommitAndPromoteApart.CAS*unit tests on02a2511744c: release 2666, ASan 2670, all passed.CAS*unit tests on74562b9f124(after mergingantalya-26.6): release 2823, all passed.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Content-addressed storage: a failed ref-log commit now says in its message whether the write is durable, of unknown outcome, or not durable, and so whether a client retry can duplicate it. Behaviour is unchanged.
Documentation entry for user-facing changes
docs/en/antalya/cas/operations/troubleshooting.md(#cas-commit-errors) anddocs/en/antalya/cas/architecture/part-lifecycle.md(crash rows C6, C10, C11).CI/CD Options
Exclude tests:
Regression jobs to run: