Repository navigation
Promote a failed multi's aggregate error for in-process Keeper callers - #117135
Conversation
On a failed multi-write, KeeperStorage left the transaction's aggregate error ZOK and reported the real error only in the failing subresponse. This matches the ZooKeeper wire convention (the aggregate is not serialized; a client reconstructs it from per-operation errors in ZooKeeperMultiResponse::readImpl). An in-process caller reading the response object directly (via KeeperOverDispatcher) never goes through that path, so it saw ZOK for a rolled-back transaction and treated the failed multi as successful. Set the aggregate to the failing operation's error, matching TestKeeper and the wire client's readImpl. Transparent to the wire protocol (writeImpl serializes per-operation errors, not the aggregate). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Workflow [PR], commit [bc056a2] Summary: ❌
AI ReviewSummaryThis PR moves failed- Final Verdict✅ No new findings. LLVM Coverage ReportMeasured on commit bc056a2.
Changed lines: Changed C/C++ lines covered: 40/43 (93.02%) · Uncovered code |
|
@groeneai, investigate the failure: https://github.com/ClickHouse/ClickHouse/actions/runs/33302311291/job/99239742949 and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
Not a separate bug: the 32 Setting the aggregate error makes the multi response header non-ZOK, and both ends of the protocol treat a non-ZOK header as "no body", so the per-operation errors are never transmitted:
536 lines of
All of these reach Keeper over TCP ( The ZOK aggregate on a rolled-back multi is what the protocol prescribes rather than an oversight, see the comment and the promotion at The gap you are after is one layer up: Nothing to link: CIDB has no occurrence of |
A failed multi transaction carries its real error in the failing subresponse while the aggregate error is left ZOK (the ZooKeeper wire convention). The TCP client derives the aggregate from the subresponses in ZooKeeperMultiResponse::readImpl. A response obtained in-process through KeeperOverDispatcher never goes through that deserialization, so the aggregate stayed ZOK and a caller reading the response object directly treated a rolled-back transaction as successful. KeeperOverDispatcher::multi now applies the same normalization (promoteMultiResponseError) before invoking the callback. The wire format is untouched (writeImpl serializes per-operation errors, not the aggregate), so this only affects in-process callers. This supersedes the earlier source-level attempt: stamping the aggregate in KeeperStorage made ZooKeeperResponse::write drop the multi body over the wire (the body is serialized only when the header error is ZOK), breaking every wire client on a failed multi. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units205 translation units recompiled, 1733 s compile time in total, 205 of them have a recent master baseline. |
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
readImpl derived a failed multi's aggregate error from the subresponses inline; extract that into the shared promoteMultiResponseError so the wire path and the in-process KeeperOverDispatcher path use one implementation instead of duplicated logic. readImpl runs only for a ZOK header, so calling the helper after the read loop is equivalent to the previous inline promotion. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Not new, and not your diff. It is the trunk The abort is From That Neither the fuzzer nor patch parts are needed. The 5-statement reproducer and the fix that rejects such an Why it read as new: the |
Document the failed-multi aggregate convention once at promoteMultiResponseError and keep both call sites terse (the wire path and the in-process KeeperOverDispatcher path share one implementation, so the 'must stay in sync' framing no longer applies). Move the readImpl call to right after the per-operation read loop, where the subresponse errors are complete (the footer block only validates the trailing marker). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@groeneai, two new untracked failures on the current run (sha fdd5f8c, run https://github.com/ClickHouse/ClickHouse/actions/runs/33512116655):
Please investigate and provide fixes in separate PRs. If either is already in progress, link it here. (AST fuzzer failures STID 2508-5166 / 3413-350b are the same pre-existing MODIFY ORDER BY direction bug from #116473 — not re-reported.) |
|
Both already have fix PRs, and neither comes from your diff (which is confined to 1. BuzzHouse (amd_msan), STID 3782-2f00. Fix in progress: #107091 (mine, open), issue #106736.
Pre-existing: 14 hits on 12 unrelated PRs plus one true-master run since 2026-07-24. 2. Docs examples. Already fixed and merged: #117459, today at 13:55:50Z. The documented output was pinned to August, so the example went red at the month rollover: 2026-09-01 04:00 UTC is midnight in Your run was triggered at 13:13:34Z, 42 minutes before that merge, and |
On a failed multi transaction the aggregate error is left
ZOKand the real error is carried only in the failing subresponse — the ZooKeeper wire convention. A client that receives the response over the network reconstructs the aggregate from the per-operation errors inZooKeeperMultiResponse::readImpl. A caller that obtains the response in-process throughKeeperOverDispatchernever goes through that deserialization, so it sawZOKfor a rolled-back transaction and treated the failed multi as successful.KeeperOverDispatcher::multinow applies the same normalization as the TCP client (promoteMultiResponseError) before invoking the callback. The wire format is untouched —writeImplserializes per-operation errors, not the aggregate — so this only affects in-process callers. Covered by a gtest that drives the adapter's multi callback on a failed batch and asserts the aggregate error is promoted.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed an in-process Keeper client (
KeeperOverDispatcher) reporting a failedmultitransaction as successful, because a rolled-back batch's aggregate error was leftZOK.Workflow [PR]
Sync PR [sync-upstream/pr/117135]