Repository navigation
Run the kill and timeout inserts of test_inserts_with_keeper_retries synchronously - #123076
Conversation
…hronously Since ClickHouse#111663 a single-block INSERT ... SELECT into MergeTree takes the async insert queue by default. The client query then only waits for the flush, while the sink and its Keeper retry loop run in the flush under another query id, so KILL QUERY and max_execution_time stop only the wait. test_ambiguous_zk_commit_kill_preserves_data failed on master (Integration tests (arm_binary, distributed plan, 3/4)) because its count() raced the flush's next retry: the part landed 70 ms after the read. The kill test also no longer reached the ambiguous-commit preserve path of ClickHouse#111196, the timeout test's TIMEOUT_EXCEEDED came from the wait, and the < 10 s bound of test_query_timeout_with_zk_down was met by the wait while the flush kept retrying. Pin async_insert=0 on these three inserts and on the two deduplication re-inserts, which model a client retrying the same statement, as ClickHouse#111663 did for test_jbod_balancer, test_azure_403_handling and test_rename_column. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…etries ran synchronously The pinned async_insert=0 forces the synchronous route only while the table-level async_insert MergeTree setting is off, and the tests' assertions also pass on the async insert queue route. Assert from system.query_log that each of the three inserts did not push to the queue (ProfileEvents['AsyncInsertQuery'] = 0), and that the zk_down insert ends with TIMEOUT_EXCEEDED, so a routing change fails the tests instead of silently hollowing them out again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… on the default route Insert deduplication uses the same hash on the synchronous and the async insert queue route, so the async_insert=0 pins on the two re-inserts changed nothing the tests check. Drop them: the re-inserts take the default route of a plain retry and are still deduplicated against the part the killed or timed-out insert preserved. 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; 3 rounds with 1, 1 and 0 findings) plus my own cold review (3 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-11:20260930-133200 |
|
Workflow [PR], commit [f39e8fa] Summary: ✅ AI ReviewSummaryThis PR pins the three Final Verdict✅ No findings. |
Related: #111663
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required: CI-only change.
Description
test_inserts_with_keeper_retries/test.py::test_ambiguous_zk_commit_kill_preserves_datafailed on master inIntegration tests (arm_binary, distributed plan, 3/4)(report):test.py:324 assert '0\n' == '10\n'.Since #111663, a single-block
INSERT ... SELECTgoes through the async insert queue by default. The client query then only waits, while the sink and its Keeper retry loop run in the flush under another query id, soKILL QUERYandmax_execution_timestop only the wait. The kill test'scount()races the flush's next retry (the part landed 70 ms after the read) and never reaches the ambiguous-commit preserve path of #111196. Likewise, the timeout test'sTIMEOUT_EXCEEDEDand the< 10 sbound oftest_query_timeout_with_zk_downare met by the wait while the flush keeps retrying.I pin
async_insert=0on these three inserts, as #111663 did intest_jbod_balancer,test_azure_403_handlingandtest_rename_column. Each test also checks insystem.query_logthat its insert skipped the queue (ProfileEvents['AsyncInsertQuery']is 0), so a later routing change fails it instead of hollowing it out again. The module's other inserts, the deduplication re-inserts included, keep the default route: their client waits for the flush, and deduplication does not depend on the route.Validation on a master debug build:
test.py:324on master and passes 5/5 with the pin.commitPart's retries fails the fixed zk_down test but not the unfixed one.Preserve-on-timeout inside an async flush is no longer exercised; it runs the same code as the synchronous sink.
🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/123076]
Version info
26.10.1.1565-master(included in26.10and later)