Repository navigation
Check the setup of 05229 and 05230 before writing a replication log entry into ZooKeeper - #127123
Conversation
…oKeeper by hand Under stress fault injection the first INSERT of 05230 failed (Code 241), so no part was created and part_name came back empty. The test then wrote a merge entry with an empty `into` part into the table's log/ by hand. LogEntry::parse accepts it, both replicas copy it into their queues, and insertUnlocked rejects it only after the ZooKeeper multi committed, inside the catch-all of pullLogsToQueue that calls std::terminate(). 05229 writes a get entry the same way; its fatal shape is a failed part-name SELECT (an empty part_type fails in LogEntry::parse, before the multi, and only wedges the queues). Read the part with a query that returns a row only when r2 holds exactly one active part with all 100 rows, and exit before any hand-written ZooKeeper write otherwise. The state is checked rather than the client's exit code because the stress AST fuzzer and fault injection can change it while every query succeeds, and the capture query itself can fail. Stress test (amd_msan), STID 4362-110a: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=110105&sha=b690c448969420c8c4fe3548cf0dfa4262c8c5cf&name_0=PR&name_1=Stress%20test%20%28amd_msan%29 Stress test (arm_asan_ubsan), STID 4362-43f8: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=112950&sha=9bc143e56853b7b122d17053abc6fa996ff22a93&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%29 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold review of the diff (0 findings). Checked: the guard precedes both hand-written ZooKeeper writes ( Session id: cron:clickhouse-review-slot-9:20261021-065700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261021-063600 |
|
Workflow [PR], commit [5809835] Summary: ✅ AI ReviewSummaryThe PR checks that replica Missing context / blind spots
Final VerdictStatus: ✅ Approve |
|
cc @tavplubix, could you review this and add the |
956abbe
Related: #119189
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required: test-only change.
Description
05230_merge_entry_for_local_part_missing_in_zookeeperaborted the server inStress test (amd_msan)(report, STID 4362-110a) and inStress test (arm_asan_ubsan)(report, STID 4362-43f8). Neither carrier PR is related.Stress fault injection failed the test's first
INSERT(Code: 241 ... fault injected), so no part was created andpart_namecame back empty. The test then wrote a merge entry with an emptyintopart into the table'slog/by hand.LogEntry::parseaccepts it, both replicas copy it into their queues, and only after that ZooKeeper multi commits doesReplicatedMergeTreeQueue::insertUnlockedreject the name (BAD_DATA_PART_NAME). The exception lands in the catch-all wherepullLogsToQueuecallsstd::terminate()on purpose, because its in-memory state no longer matches ZooKeeper, so the server aborts with signal 6.05229writes agetentry the same way.Both tests now read the part with a query that returns a row only when
r2holds exactly one active part with all 100 rows, and stop with one line on stdout before any hand-written ZooKeeper write otherwise. That state is what the references already assert, so a normal run is unchanged.Validation on a master debug build: one injected failing query (the
INSERTin05230, the part-nameSELECTin05229) makes the original tests abort the server with the CI stack every time, and makes the fixed tests exit with the new line while the server stays up. Each test passes 50/50 with randomized settings. 200 runs withmemory_tracker_fault_probability=0.05stopped at the check 13 times, with no abort.Workflow [PR]
Sync PR [sync-upstream/pr/127123]
Version info
26.11.1.583-master(included in26.11and later)