Repository navigation
Do not enable parallel replicas for tests tagged no-parallel-replicas - #114279
Conversation
The stress runner appends enable_parallel_replicas=1 (and async_insert=1) to --client-option for a random ~20% of its workers, without looking at test tags. clickhouse-test deliberately places --client-option values after the randomized settings, so with --allow_repeated_settings (last occurrence wins) nothing downstream could turn the feature back off, and the tag's only other enforcement is a skip gated on --no-parallel-replicas, which the stress job never passes. Every one of the 447 tagged tests therefore ran with parallel replicas on in those workers. 04241_parameterized_view_used_twice aborts the server that way: its first query reads one table both in order (outer ORDER BY) and unordered (two IN-subqueries through a parameterized view), the coordinator map is keyed on stream_id alone, and the second announcement throws Logical error: 'Coordination mode mismatch for stream <db>.testing_105153: got Default, expected WithOrder' which kills the worker and loses every remaining test in it. That accounts for 12 of the 14 stress hits of this signature in the last 30 days, across 12 unrelated pull requests and 8 stress jobs. Append a tag-derived feature-off override last, where --allow_repeated_settings makes it win. A SET or SETTINGS clause inside a test still beats a client command line value, so the 15 tagged tests that manage parallel replicas themselves keep working; this was verified from system.query_log in both the .sql and .sh channels. The same defect and the same fix apply to no-async-insert. Measured on the 40 ordinary tagged tests exercised with the injection forced on: 16 go from failing to passing and none regress. Their tags say why, for example 00944_minmax_nan: "no-parallel-replicas: EXPLAIN output differs for parallel replicas". This does not skip, weaken or blacklist any test, and it does not touch the coordinator. The remaining 2 of 14 hits come from untagged tests that enable parallel replicas deliberately; that is a coordinator issue and is left to its owners. Related: ClickHouse#106039
Internal second-model review (cold review + independent gate, 3 findings, 0 blocking)Reviewed independently of the author, without the implementation notes, then a second model
Also checked and clean, in case it saves a reviewer the trouble:
Same pattern at the same site as my open #109130, so whichever of the two merges second needs a Session id: cron:clickhouse-review-slot-9:20260811-045300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-40:20260811-032600 |
|
cc @maxknv, could you review this? The stress job injects |
|
@groeneai are you sure this is the soluton? The |
| @@ -0,0 +1,131 @@ | |||
| """ | |||
| Regression test for `no-parallel-replicas` / `no-async-insert` being inert against an | |||
Requested by PedroTadim in review r3759637153. The change in tests/clickhouse-test is covered end to end by the two-arm sweep over 55 tagged tests recorded in the pull request description, which exercises the real runner rather than the helper in isolation.
|
Fair challenge. Yes on the diagnosis, and the honest answer to "the whole time?" is: that tag never worked against this one injection path, and it worked everywhere else. Numbers below are re-measured on the pushed head, not copied from the description. Where the tag was inert. I verified the precedence against the real client rather than assuming it, and the arms discriminate:
So order decides rather than the value, and a test that wants the feature still gets it. Where it worked fine. Everywhere else the tag is honoured: the Scale. 440 tests carry Why it only started aborting now. The injection dates to May 2024 (commit 5102c6e, renamed to Scope, so this is not oversold. Those 2 Test removed as you asked, in 894696d. The PR is now one file, +25. The precedence and |
|
Workflow [PR], commit [894696d] Summary: ❌
AI ReviewSummaryThis PR makes Final Verdict✅ Approved |
CI finish ledger - 894696dEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
All three Session id: cron:our-pr-ci-monitor:20260812-050000 |
57f45c4
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
Requested by @ alexey-milovidov in #112052 (comment).
Stress test (*)aborts servers withLogical error: 'Coordination mode mismatch for stream <db>.testing_105153: got Default, expected WithOrder', 20 times in 30 days across 20 unrelated pull requests and 10 stress jobs, 0 on master. This fixes the 18 carried by04241_parameterized_view_used_twice; the other 2 are untagged tests enabling parallel replicas deliberately, a coordinator issue left to @ nickitat / @ devcrafter per #112052, so this PR does not eliminate the signature.Root cause. The stress runner appends
enable_parallel_replicas=1(andasync_insert=1) to--client-optionfor a random ~20% of its workers, ignoring test tags.clickhouse-testputs--client-optionafter the randomized settings on purpose, so under--allow_repeated_settings(last occurrence wins) nothing could turn the feature off again, and the tag's only other enforcement is a skip gated on--no-parallel-replicas, which the stress job never passes. All 440 tagged tests therefore ran with parallel replicas on there. 04241 aborts that way: it reads one table both in order and unordered in one query, and the coordinator map is keyed onstream_idalone.Change. Append a tag-derived feature-off override last, where
--allow_repeated_settingsmakes it win. ASETorSETTINGSclause still beats a client command line value, so the 15 tagged tests that manage parallel replicas themselves keep working. Same defect and fix forno-async-insert. Nothing insrc/; no test is skipped or weakened, and the tag already gates the other injection path this way (adjust_settings_for_autopr).Validation. Reproduced 04241's abort locally, then confirmed it passes, asserting the effective setting from
system.query_lograther than only the verdict. A negative control disabling just the override brings the abort back. Across 55 tagged tests, in two arms differing only intests/clickhouse-test, none regresses; of the 40 that do not manage the feature themselves, 16 go from failing to passing.Fixed by this change (40 ordinary tagged tests, injection forced on)
Base 18 OK / 22 FAIL, with fix 34 OK / 6 FAIL. FAIL -> OK:
00944_minmax_nan,01231_operator_null_in,01891_not_in_partition_prune,02346_text_index_dictionary_cache,02346_text_index_drop_caches,02346_text_index_header_cache,02346_text_index_hint_profileevents,02346_text_index_postings_cache,02354_vector_search_drop_table_clear_cache,02354_vector_search_quantize_codec_prewhere,02354_vector_search_rescoring_and_prewhere,02354_vector_search_rescoring_distance_in_select_list,02679_explain_merge_tree_prewhere_row_policy,02771_ignore_data_skipping_indices,02798_explain_settings_not_applied_bug,02835_join_step_explain.The 6 remaining failures are identical in both arms (single-node harness: absent cluster
members, no minio). Their tags say why they wanted the feature off, for example
00944_minmax_nan:-- no-parallel-replicas: EXPLAIN output differs for parallel replicas.Failing CI run:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=114085&sha=df7c307c738b4e8c97832dce3a735b541fd5d31c&name_0=PR&name_1=Stress%20test%20%28arm_asan_ubsan%2C%20s3%29