Repository navigation
More settings and disruptions to randomize in stress tests - #116783
Conversation
|
Workflow [PR], commit [a29c2df] Summary: ✅ AI ReviewSummaryThis PR broadens the stress worker by randomizing more session settings and by letting the disruptor stop and restart more background subsystems. Several of those new worker-wide knobs still invalidate existing test contracts instead of adding orthogonal coverage, so I do not think the generic stress worker is safe to merge in its current form. Findings❌ Blockers
Final VerdictChanges requested. The generic stress worker still mixes in several settings and disruptor actions that invalidate existing coverage or cause deterministic front-door failures, so the PR does not yet meet the promised “broader stress coverage” contract. |
…ranularity for non-adaptive parts A non-adaptive data part stores no per-mark row counts on disk: its mark file holds only the two offsets per mark, so the rows per granule have to be reconstructed when the part is loaded, and they are reconstructed from the READING table's `index_granularity`. `MergeTreeData::canReplacePartition` is the only compatibility gate on the partition-manipulation path, and it compared mark adaptivity only. With both tables non-adaptive (`index_granularity_bytes = 0`) neither adaptivity branch fires, so a part written at `index_granularity = N` was admitted into a table declared with `index_granularity = M != N`. `MergeTreeDataPartWide::loadIndexGranularityImpl` then paired the source's mark offsets with the destination's rows per mark, mapping every mark to the wrong row range. Observable consequences, both measured on 8627fa2: - Release build: the part attaches and the table disagrees with itself. For 18 rows moved from `index_granularity = 8` into `index_granularity = 4`, `SELECT count() FROM t WHERE <primary key condition>` returned 10; in the other direction (4 into 8) it returned 24, while `SELECT count() FROM t` returned the correct 18. - Debug and sanitizer builds: the consistency check in `IMergeTreeDataPart::loadRowsCount` throws `LOGICAL_ERROR`, which those builds turn into a server abort. The new condition is placed outside the `enable_mixed_granularity_parts` block on purpose: a destination that accepts mixed granularity still reinterprets a non-adaptive part, because `changeGranularityIfRequired` clears `mark_type.adaptive` and `index_granularity_bytes` from the filesystem but leaves `fixed_index_granularity` at the destination's value. That case was measured to abort on master too, and it is the only arm of the new test that distinguishes this placement from putting the check inside the block. Comparing against the source part's own `fixed_index_granularity` is sound because `index_granularity` is read-only after table creation (`MergeTreeSettings::isReadonlySetting`, enforced as `READONLY_SETTING` in `MergeTreeData::checkAlterIsPossible`), so for any part the source table wrote itself the setting is the value the part was written with. `MergeTreeDataPartCompact` needs no equivalent guard: a Compact part is always adaptive and its marks record per-granule row counts, so nothing is reconstructed. Verified that a non-adaptive table cannot write a Compact part even with `min_bytes_for_wide_part` and `min_rows_for_wide_part` set to 1e9. The condition only ever adds rejections, so it cannot make a previously rejected operation succeed. Previously accepted DDL now errors with `BAD_ARGUMENTS`; the accepted cases produced a part whose marks map to the wrong rows unless the partition fitted in a single granule. The new test arms live in the existing `04150_move_partition_inconsistent_granularity`, which carries `no-shared-merge-tree`: in Cloud `ReplicatedMergeTree` is substituted by `SharedMergeTree`, whose partition-move path does not call `canReplacePartition`. Dropping that tag is what got ClickHouse#103881 reverted. The arms cover both directions of the mismatch and all of `REPLACE`/`MOVE`/`ATTACH PARTITION FROM`, so a one-sided comparison does not satisfy them. `r_src_nonadaptive` pins `index_granularity = 8192`, its default, because `clickhouse-test` otherwise injects a random value as the CREATE TABLE default and a draw equal to the destination's 4096 would remove that arm's expected rejection. One arm asserts an acceptance instead: an adaptive source part at a different `index_granularity` is still admitted, because its marks carry per-granule row counts and the destination's setting never enters their interpretation. It pins the scope of the new condition, so dropping the `!adaptive` conjunct would be caught by the test rather than silently rejecting a valid transfer. That arm pins its source part to the `Wide` format, which is the format whose granularity load path holds the defect, and without which restating the conjunct as a `Wide` part-type test would also pass. Reported and root-caused by Pedro Ferreira. Found by the server-side AST fuzzer under Stress test (arm_debug) on ClickHouse#116783 : https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=116783&sha=dd8310bb0d928a3aa50822f052cc835cf86efac0&name_0=PR&name_1=Stress%20test%20%28arm_debug%29 Closes ClickHouse#117524
|
|
||
| if random.random() < 0.2: | ||
| # Collect per-query metrics every 100ms instead of the default 1000ms. | ||
| client_options.append("query_metric_log_interval=100") |
There was a problem hiding this comment.
query_metric_log_interval=100 changes a default that existing stateless tests still rely on. tests/queries/0_stateless/03203_system_query_metric_log.sh:13-17 intentionally leaves the first sleep(2.5) query at the default interval, then validates it as the 1000-ms case in check_log 1000 at lines 83-85. With this worker-wide client option that query now emits roughly 10x more system.query_metric_log rows than the test's upper bound allows, and clickhouse-test has no feature-tag override for query_metric_log_interval analogous to no-async-insert / no-parallel-replicas.
Can we keep this setting out of the generic stress worker, or add a dedicated opt-out surface for tests that assert the default metric-log cadence?
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=6 K_base=30 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
| # coordination step can draw a fault, exercising the retry and dedup logic. | ||
| # users.d/insert_keeper_retries.xml already sets 0.01 server-wide, so only a higher | ||
| # value adds anything here; it also raises insert_keeper_max_retries to 100. | ||
| client_options.append("insert_keeper_fault_injection_probability=0.05") |
| # znodes. This one throws instead of retrying, and a CREATE is far rarer than an INSERT | ||
| # commit, so it gets a higher probability than the two above but stays low. | ||
| client_options.append( | ||
| "create_replicated_merge_tree_fault_injection_probability=0.01" |
There was a problem hiding this comment.
probability too low. is it failing?
… load Upgrade check (amd_release) runs on every pull request and began losing its server on roughly one run in five on 2026-09-11: 24 of 126 shas that day carried 'Got read request from replica 0 for unknown stream ...' (ParallelReplicasReadingCoordinator.cpp:1316), against 0 of 3457 shas over the preceding twelve days. The abort kills the server, so the job reports "Server died" and loses every remaining assertion in it. The cause is a harness change, not an engine change. ClickHouse#116783 added a nested serialize_query_plan=1 draw inside the stress option generator's parallel-replicas arm without the 'not upgrade_check' guard its sibling arms carry. The upgrade check's only test load runs against the previous release server, resolved at run time (currently v26.8.2.7), and that shipped binary aborts on the serialized-plan parallel-replicas path. Because the defect is in a released binary, no change to master can clear it from this job, which is what makes the red permanent rather than a bug report. The same option on a current build is not implicated: over 09-04 to 09-11 Stress test (*), which gets the identical arm at the identical probability against the PR's own build, produced 0 to 1 affected shas per day out of 259 to 483, and the signature has no true-master occurrences in 30 days. So the guard is added rather than the arm removed: classic parallel-replicas coverage in the upgrade check is preserved, and serialize_query_plan coverage continues in every Stress test flavour, where a failure names a fixable defect. This matches the convention used seven times in the same function, including the enable_cascades_optimizer arm ClickHouse#116783 itself added for the same reason. Verified by executing get_options 4000 times per condition: under upgrade_check, serialize_query_plan goes from 388 to 0, while enable_parallel_replicas stays at 820, confirming the guard did not land on the outer draw, and the upgrade_check=False counts are unchanged. Related: ClickHouse#118093 Related: ClickHouse#119372 Related: ClickHouse#110518 Co-Authored-By: Claude Opus 5 <[email protected]>
…ade load Since ClickHouse#116783 the stress randomization enables `cast_keep_nullable = 1` in a third of the runs, and, unlike its sibling arms, without the `not upgrade_check` guard. The upgrade check runs that load against the previous release's server (26.8.2.7), which predates ClickHouse#119385: it matches the sorting key `CAST(json.b, 'String')` to the same expression in `ORDER BY` by name and arity only, although under `cast_keep_nullable = 1` the query types it `Nullable(String)` while the key is `String`. Read-in-order with `read_in_order_use_virtual_row = 1` then aborts the shipped 26.8 server in `setVirtualRow` with `Logical error: Virtual row has different type` while running `03277_json_subcolumns_in_primary_key`, so `Upgrade check (amd_release)` went red on dozens of unrelated pull requests (57 on 2026-09-11, 23 on 2026-09-12, 7 on 2026-09-13). A master fix cannot clear it, because the exception is raised by the old binary. Guard the arm like the sibling `serialize_query_plan` arm (5620afa). CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=99495&sha=c84da07b7cc18cc399ef06b7fc656f99a72b713a&name_0=PR&name_1=Upgrade%20check%20(amd_release) PR: ClickHouse#99495 Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ade load Since #116783 the stress randomization enables `cast_keep_nullable = 1` in a third of the runs, and, unlike its sibling arms, without the `not upgrade_check` guard. The upgrade check runs that load against the previous release's server (26.8.2.7), which predates #119385: it matches the sorting key `CAST(json.b, 'String')` to the same expression in `ORDER BY` by name and arity only, although under `cast_keep_nullable = 1` the query types it `Nullable(String)` while the key is `String`. Read-in-order with `read_in_order_use_virtual_row = 1` then aborts the shipped 26.8 server in `setVirtualRow` with `Logical error: Virtual row has different type` while running `03277_json_subcolumns_in_primary_key`, so `Upgrade check (amd_release)` went red on dozens of unrelated pull requests (57 on 2026-09-11, 23 on 2026-09-12, 7 on 2026-09-13). A master fix cannot clear it, because the exception is raised by the old binary. Guard the arm like the sibling `serialize_query_plan` arm (5620afa). CI: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=99495&sha=c84da07b7cc18cc399ef06b7fc656f99a72b713a&name_0=PR&name_1=Upgrade%20check%20(amd_release) PR: #99495 Co-Authored-By: Claude Fable 5.1 <[email protected]> (cherry picked from commit 6b1566c)
…compatibility The four settings added by the 24.10 BACKUP ON CLUSTER coordination rewrite (backup_restore_failure_after_host_disconnected_for_seconds, backup_restore_keeper_max_retries_while_initializing, backup_restore_keeper_max_retries_while_handling_error, backup_restore_finish_timeout_after_error_sec) carry "New setting" history records with a previous value of 0, so compatibility <= 24.10 sets them to 0. In the current code 0 means no Keeper retries while initializing or handling an error, no lost-host detection and an untimed wait after an error. A host that fails its first Keeper step and then fails to write its error never reports anything, so the initiator's waitOtherHostsFinish(throw_if_error = false) in BackupStarter::onException waits forever: KILL QUERY does not stop it and shutdown_wait_backups_and_restores blocks server shutdown. No release behaved like this: 24.9 retried those steps with backup_restore_keeper_max_retries (20) and did not wait for other hosts after an error. Stress tests hit it through compatibility randomization plus backup Keeper fault injection (ClickHouse#116783). Add a 26.10 CompatibilitySetting::Ignore record (ClickHouse#114190) to each of the four settings, so any compatibility value keeps their defaults. The 24.10/24.11 records are unchanged, backup_restore_keeper_max_retries still rolls back to 24.9's 20, and an explicit SET still wins. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Broaden stress-test coverage by randomizing more session settings per query
and letting the random disruptor pause and resume more background subsystems.
Workflow [PR]
Sync PR [sync-upstream/pr/116783]
Version info
26.9.1.1137(included in26.9and later)