Repository navigation
Remove duplicate MergeTree settings from system.completions - #102015
alexey-milovidov merged 5 commits into
Conversation
fillDataWithMergeTreeSettings() was calling dumpToSystemCompletionsColumns() for both getMergeTreeSettings() and getReplicatedMergeTreeSettings(). Both return the same MergeTreeSettings type with identical setting names (they only differ in values), so this produced 329 duplicate rows. Remove the redundant getReplicatedMergeTreeSettings() call since completions only need the names. Closes ClickHouse#102013
|
Pre-PR Validation (session cron:clickhouse-ci-task-worker:20260408-024500) (a) Deterministic repro? Yes — (b) Root cause explained? (c) Fix matches root cause? Yes — removed the (d) Test intent preserved / New test added? New test (e) Both directions demonstrated? Unpatched binary: 329 duplicates. Patched binary: 0 duplicates. Test passes 5/5 runs. (f) Fix is general? This is the only call site that dumps MergeTree settings into completions. No other system table has this pattern. |
|
cc @alexey-milovidov @azat — could you review this? It removes the duplicate MergeTree settings from system.completions by dropping the redundant getReplicatedMergeTreeSettings() dump (same type, same names as getMergeTreeSettings()). |
| -- Previously, both getMergeTreeSettings() and getReplicatedMergeTreeSettings() | ||
| -- were dumped, producing identical rows since they share the same setting names. | ||
|
|
||
| SELECT word, count() AS cnt |
There was a problem hiding this comment.
Also, check that at least one ReplicatedMergeTree-specific setting is present.
|
Workflow [PR], commit [f279d90] Summary: ✅ AI ReviewSummaryThis PR removes a duplicate insertion path in Final Verdict
|
|
The flaky test failures in this PR ( |
Split flaky check and targeted check into separate roles: Flaky check — runs only new/modified tests from the PR with thread fuzzer enabled. Tests run in parallel with themselves (shared queue) to ensure new tests are parallel-safe under randomized thread ordering. Targeted check — runs previously failed and coverage-relevant tests with per-worker partitioning (--no-self-parallel) so the same test never runs concurrently on multiple workers, avoiding conflicts on shared resources (hardcoded users, roles, settings profiles, etc.). Both use --test-runs 50. Changes: - Add --no-self-parallel flag to clickhouse-test: partitions tests by name hash so all copies go to the same worker - Flaky check: only changed tests, thread fuzzer, shared queue - Targeted check: relevant tests, no thread fuzzer, per-worker queues, 50 runs, single clickhouse-test invocation - Restore original thread fuzzer parameters (reverts reductions from 06c945a and 9790435) - Add amd_binary to flaky check, use AMD_LARGE for targeted debug - Targeted check uses --flaky-check --no-self-parallel PRs affected by tests running in parallel with themselves: #102015 #101093 #99653 #101503 #101108 #101884 #100746 #101447 #100941 #101099 #100203 #96130 #102038
Split flaky check and targeted check into separate roles: Flaky check — runs only new/modified tests from the PR with thread fuzzer enabled. Tests can run in parallel with themselves (shared queue) to ensure new tests are parallel-safe. Targeted check — runs previously failed and coverage-relevant tests with per-worker partitioning (--no-self-parallel) so the same test never runs concurrently on multiple workers, avoiding conflicts on shared resources (hardcoded users, roles, settings profiles, etc.). Both use --test-runs 50. Changes: - Add --no-self-parallel flag to clickhouse-test: partitions tests by name hash so all copies go to the same worker - Flaky check: only changed tests, thread fuzzer, shared queue - Targeted check: relevant tests, no thread fuzzer, per-worker partitioning, 50 runs, single clickhouse-test invocation - Restore original thread fuzzer parameters - Change targeted check to arm_asan_ubsan on ARM_LARGE PRs affected by tests running in parallel with themselves: #102015 #101093 #99653 #101503 #101108 #101884 #100746 #101447 #100941 #101099 #100203 #96130
|
@groeneai, please continue on this PR. |
Address inline review by @alexey-milovidov on PR ClickHouse#102015: extend the 04084_system_completions_no_duplicates test with a sanity check that at least one ReplicatedMergeTree-specific setting (e.g. `replicated_can_become_leader`, `replicated_deduplication_window`) is present in `system.completions` after the fix. These settings live inside the `MergeTreeSettings` struct itself, so dropping the redundant `getReplicatedMergeTreeSettings()` dump must NOT have removed them. The new query guards against accidentally losing replicated-specific names if the dump logic changes. Verified locally: with the patched binary the test passes 5/5, producing 0 duplicate rows for `merge tree setting` and a single `1` for the replicated-presence check (17 unique `replicated_*` settings remain after the fix).
|
@alexey-milovidov done — pushed What the new check does: SELECT count() > 0
FROM system.completions
WHERE context = 'merge tree setting'
AND startsWith(word, 'replicated_');This guards against accidentally losing replicated-specific names if the dump logic changes. The settings (e.g. Local verification (Debug build, clang-21, master + this PR's source change applied):
Session: cron:clickhouse-ci-task-worker:20260426-151500 |
…ons-duplicate-mergetree-settings
|
This was fixed by #105146. Let's update the branch. |
…ons-duplicate-mergetree-settings
LLVM Coverage Report
Changed lines: 100.00% (2/2) · Uncovered code |
Split flaky check and targeted check into separate roles: Flaky check — runs only new/modified tests from the PR with thread fuzzer enabled. Tests run in parallel with themselves (shared queue) to ensure new tests are parallel-safe under randomized thread ordering. Targeted check — runs previously failed and coverage-relevant tests with per-worker partitioning (--no-self-parallel) so the same test never runs concurrently on multiple workers, avoiding conflicts on shared resources (hardcoded users, roles, settings profiles, etc.). Both use --test-runs 50. Changes: - Add --no-self-parallel flag to clickhouse-test: partitions tests by name hash so all copies go to the same worker - Flaky check: only changed tests, thread fuzzer, shared queue - Targeted check: relevant tests, no thread fuzzer, per-worker queues, 50 runs, single clickhouse-test invocation - Restore original thread fuzzer parameters (reverts reductions from 06c945a and 9790435) - Add amd_binary to flaky check, use AMD_LARGE for targeted debug - Targeted check uses --flaky-check --no-self-parallel PRs affected by tests running in parallel with themselves: ClickHouse#102015 ClickHouse#101093 ClickHouse#99653 ClickHouse#101503 ClickHouse#101108 ClickHouse#101884 ClickHouse#100746 ClickHouse#101447 ClickHouse#100941 ClickHouse#101099 ClickHouse#100203 ClickHouse#96130 ClickHouse#102038
fillDataWithMergeTreeSettings()inStorageSystemCompletions.cppwas callingdumpToSystemCompletionsColumns()for bothgetMergeTreeSettings()andgetReplicatedMergeTreeSettings(). Both return the sameMergeTreeSettingstype with identical setting names — they only differ in values (replicated
adds overrides from the
replicated_merge_treeconfig section). Sincecompletions only need the names for autocomplete, this produced 329 duplicate
rows.
The fix removes the redundant
getReplicatedMergeTreeSettings()call and addsa regression test that asserts no MergeTree setting appears more than once.
Changelog category (leave one):
Changelog entry:
Fixed duplicate rows in
system.completionsfor MergeTree settings — eachsetting name appeared twice because both
getMergeTreeSettings()andgetReplicatedMergeTreeSettings()were dumped despite having identicalsetting names. Closes #102013.
Documentation entry for user-facing changes
Version info
26.5.1.796