Repository navigation
More settings to randomize - #106734
More settings to randomize#106734PedroTadim wants to merge 18 commits into
Conversation
|
Workflow [PR], commit [46aed86] Summary: ❌
AI ReviewSummaryExpands query and FindingsTest filenames below are relative to
Tests
Final VerdictStatus: Pin the AutoPR byte freeze bound, preserve the cited regression paths and deterministic assertions, and verify or exclude the two source-traced failure combinations. The new finding was posted inline; dismissed threads were left untouched. |
This is a pipeline-deadlock regression test (issue #57728): it checks that a full_sorting_merge join with the PingPongProcessor / FilterBySetOnTheFly optimization no longer hangs. The deadlock detection is driven entirely by the pinned query-level SETTINGS (join_algorithm = 'full_sorting_merge', query_plan_join_swap_table = 0, max_threads = 2) and is independent of the table's on-disk layout. CI randomizes MergeTree settings per run, and two unrelated randomized combinations break this test without exercising any new pipeline behavior: 1. index_granularity = 1 with min_bytes_for_wide_part = 0 produces ~1M marks for the 1M-row tables, making each INSERT ~20x slower. On the slow amd_msan / WasmEdge runner this pushes the total runtime past the 180s timeout (seen on PR #101143). The query still returns the correct result; it is pure slowness, not a deadlock. 2. part_minmax_index_columns = 'with_block_number_offset' without enable_block_number_column / enable_block_offset_column is rejected at CREATE TABLE with BAD_ARGUMENTS (seen on PR #106734, amd_tsan and arm_binary). Pinning a single setting cannot cover both classes, and the test does not depend on MergeTree storage randomization for any of its coverage. Add the no-random-merge-tree-settings tag, which disables only MergeTree-settings randomization while leaving session-level setting randomization (where the pipeline / join behavior lives) intact. The same tag is used by sibling tests (00564, 00926, 02981) for the same reason. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Randomize more session and `MergeTree` settings in `clickhouse-test`, and keep the tests whose observable output (plans, part formats, cache or `ProfileEvents` counts) depends on them stable by pinning those settings in the tests: - Randomize new session settings, among them `enable_fixed_and_packed_string_keys_in_aggregation`, `enable_parallel_single_level_merge_by_index`, `merge_tree_read_end_tasks_per_stream`, `load_marks_asynchronously`, the columns cache write limits, the hash join and text index settings, `use_datalake_metadata_statistics` and four settings that do not change results. - Randomize new `MergeTree` settings, among them `max_row_mask_update_coalescing_ast_bytes`, `max_row_mask_update_coalescing_key_bytes` and `max_memory_ratio_to_activate_adaptive_write_buffer`, and follow the rename to `secondary_indexes_enable_bulk_filtering`. - Make the randomizer respect the `ReaderExecutor` plan-look-ahead constraint and remove the dead DPsub join-order-limit clamp. - Pin the randomized settings in the tests that check what they change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…odings of one row group Co-Authored-By: Claude Opus 5.5 <[email protected]>
…checks the lazy read steps Co-Authored-By: Claude Opus 5.5 <[email protected]>
…_filter The test checks which runtime filter `EXPLAIN ANALYZE` reports. Settings randomized by #106734 change it, each by design: a low `join_runtime_filter_exact_values_limit` or `join_runtime_bloom_filter_bytes` (the byte limit of the exact set) turns the exact set into a Bloom filter, and `hash_join_layout = 'parallel'` or `enable_join_fixed_hash_table_conversion = 0` leaves no `FixedHashMap` for the shared filter. CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106734&sha=757685076585b406a859818f17520bf09ce1941e&name_0=PR PR: #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each failure reproduces only with one randomized setting and changes what the test observes, not the query results: - `05558_trivial_group_by_limit_constraints`: `optimize_trivial_group_by_limit_query = 0` makes `max_rows_to_group_by` throw, as the test asserts for the profile that pins 0; the query now uses the value the profile pins, otherwise the default. - `05480_autopr_plan_based_group_by_order_by_top_k`: `adaptive_aggregator_freeze_threshold` changes the `AutoParallelReplicasNoStatistics` counter. - `05627_aggregate_projection_optimizer_stored_query`: a tiny `query_plan_max_set_size_for_projection_match` stops the projection from matching, which `force_optimize_projection` rejects. - `05843_in_set_index_shared_sort`: `prefer_optimize_projection` skips the primary key pruning the test checks. - `05075_mutation_partition_pruning_table_in_set`: without `optimize_mutations_with_partition_pruning` every mutation covers every partition in `system.mutations`. #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pin does not fix the test: it still fails with the threshold at its default, also with `adaptive_aggregator_freeze_threshold_bytes` at its default, so another randomized setting changes the `AutoParallelReplicasNoStatistics` counter. As a changed test it now runs in the flaky checks, where it fails often enough to stop the jobs early. The cause is not known yet, so the test is left unpinned. #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The aggregation of `GROUP BY ... LIMIT` without `ORDER BY` always gets `observation_rows = 0` (`optimizeGroupByTopK`), and the value is part of the serialized aggregation step that the statistics of automatic parallel replicas are keyed by. With the randomized value 0 the earlier `ORDER BY` queries of the test have the same aggregation step, so the query without `ORDER BY` finds their statistics and does not count `AutoParallelReplicasNoStatistics`. The results do not change. Found from the `query_log` dumps of the CI jobs: the value 0 was set in all 16 failing runs and in none of the 45 passing ones; reproduced locally. #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test compares the joins at the default minimum with the same joins at 0, which it sets for each query. A randomized 0 for the session makes the default queries pack their keys as well, so the `JoinPackedStringKeys*` counters of those lines change; the results do not. #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Session: `json_use_optimized_type_conversion` (the optimized and the legacy `JSON` type conversion), `read_in_order_max_bytes_to_prefetch`, `enable_robin_hood_hash_for_joins`, `query_plan_use_shuffle_for_order_by_rand`, `output_format_parquet_data_page_row_limit` and `output_format_arrow_max_record_batch_size_bytes`. `MergeTree`: `serialize_statistics_bounds_with_column_type` (the `V5` statistics format) and `adaptive_codec_selection_period`, which takes effect with the already randomized `enable_adaptive_codec_selection`. None of them changes query results; every value was checked on master. #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `04335_arrow_memory_limit_error_code`: the test needs one ~30 MiB record batch, which `output_format_arrow_max_record_batch_size_bytes = 65536` splits, so the read fits the memory limit. - `05512_parquet_metadata_cache_offset_index`: `output_format_parquet_data_page_row_limit` below the page size in rows makes more pages, so the offset indexes outgrow the byte budget of the kept ones and fewer offset index hits are counted. - `05632_json_conversion_changed_path_out_of_range`: the queries without the setting check the optimized conversion; `json_use_optimized_type_conversion = 0` gives the documented `INCORRECT_DATA` of the parser instead of `CANNOT_PARSE_IPV4`/`CANNOT_PARSE_IPV6`. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106734&sha=e78491ca2fd239d73527a3cbf699d82fe23d41ff&name_0=PR #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…w limit in 05628 - `05480_autopr_plan_based_group_by_order_by_top_k`: with `adaptive_aggregator_freeze_threshold = 1` every new key goes to the backlogs of the adaptive aggregator, which the top-K boundary does not filter (`AggregationTopKRowsSkipped` 8K-16K instead of 65K-262K), so the output bytes that mode 2 records grow from about 100 to 376K-566K and mode 1 no longer switches the priced queries to parallel replicas. In `Stateless tests (amd_debug, parallel)` the reruns with these settings failed 50 of 54 times; with the pin the recorded output bytes are about 100 again. The earlier pin to the default was right, that round failed for `group_by_top_k_optimization_observation_rows = 0`. - `05628_parquet_lazy_materialization_pages_from_headers`: `output_format_parquet_data_page_row_limit = 1000` makes pages smaller than 16 KiB, and `locatePagesFromHeaders` gives up on chunks of small pages by design, so no pages are located for the 32 KiB file. The results are unchanged. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106734&sha=e78491ca2fd239d73527a3cbf699d82fe23d41ff&name_0=PR #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `03272_json_to_json_cast_4`: with `json_use_optimized_type_conversion = 0` the legacy format+parse conversion splits the paths between dynamic paths and shared data as the reference did before #107866 updated it; the values are the same. - `05832_join_runtime_filter_bool_cast_key`: the `datetime_time_zone` query prunes only through a `bloom_filter` skip index, which is probed with the exact values of the runtime filter. With `join_runtime_filter_exact_values_limit = 1` its 3 build values become a bloom runtime filter and no granule is dropped (470 with the default limit). https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106734&sha=456c6c22fb08ccb2359b1a5d2172289fbf6e0ad2&name_0=PR #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
`join_runtime_bloom_filter_bytes = 1024` also bounds the exact set of a local runtime filter, which counts the bytes of its hash table buffer, so a set of one `Decimal` key is already full and becomes a bloom filter, which gives no key range for the primary key analysis: `05832_decimal_precision` drops no granules (509 with the default). Pin it with `join_runtime_filter_exact_values_limit` at the top of the test instead of only in the `datetime_time_zone` query, since every pruning query needs the exact values. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=106734&sha=ea45b7ce503e50372ad87206332c7bc799e66723&name_0=PR #106734 Co-Authored-By: Claude Opus 5.5 <[email protected]>
| SET group_by_top_k_optimization_observation_rows = 65536; | ||
| -- A freeze threshold of 1 sends every new key to the backlogs of the adaptive aggregator, which the top-K boundary does not | ||
| -- filter, so the aggregation output the statistics record grows and the priced queries are not switched. | ||
| SET adaptive_aggregator_freeze_threshold = 16384; |
There was a problem hiding this comment.
[Major] Pin the byte freeze bound alongside the key bound
The runner also draws adaptive_aggregator_freeze_threshold_bytes = 1, which still freezes the adaptive producers after their first block despite this key-count pin (Aggregator::adaptiveFreezeBoundReached checks either bound). With the allowed adaptive_aggregator_disable_thaw = 1 draw, subsequent blocks stay in executeFrozen, staging keys instead of applying the group-key Top-K heap. Those groups inflate the aggregation output recorded for AutoPR pricing, so the cost model can decline the queries whose assertions require AutoParallelReplicasApplied = 1—the same failure this new pin is intended to prevent.
Please also pin adaptive_aggregator_freeze_threshold_bytes = 0 (or the intended large byte bound) here.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The stateless-test runner now randomizes about 100 more query-level and MergeTree settings, among them the DP join-order algorithms (dpsub, dphyp), runtime join filters, lazy FINAL, the text-index caches, the adaptive aggregator, Iceberg and Paimon pruning, and partition-independent execution. Settings that are not transparent to queries, or that currently trigger known bugs, stay commented out with the reason next to them, and tests whose output depends on one of the new settings pin it.
Workflow [PR]
Sync PR [sync-upstream/pr/106734]