Repository navigation
Merge join-order conflict-detector settings into one enum setting - #120630
Conversation
`query_plan_optimize_join_order_use_conflict_detector_a` and `query_plan_optimize_join_order_use_conflict_detector_c` are replaced by a single `query_plan_optimize_join_order_conflict_detector`, taking `a`, `c`, or the empty string (the default, meaning no conflict detector). This is the naming asked for in #118413. That issue was closed by #118494, which renamed the settings to `..._use_conflict_detector_a` and `_c` rather than collapsing them into one setting with the requested values. Two booleans could express a state the feature does not have - both detectors at once - which the documentation had to resolve with a precedence rule ("CD-C takes precedence over CD-A when both are enabled"). A single value cannot be ambiguous, so the rule is gone. `QueryGraph::use_conflict_detector_a` and `_c` likewise become a single `QueryGraph::conflict_detector` of the new `JoinOrderConflictDetector` enum. The settings never appeared in a release: `v26.9.1.1-new` does not contain them, so the two `26.9` entries in `SettingsChangesHistory` are replaced by one `26.10` entry rather than being kept as obsolete aliases. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
Workflow [PR], commit [222fece] Summary: ✅
AI ReviewSummaryThis PR replaces the two experimental join-order conflict-detector booleans with one enum setting and threads that enum through the Findings❌ Blockers
Final Verdict
LLVM Coverage ReportMeasured on commit 222fece.
Changed lines: Changed C/C++ lines covered: 50/53 (94.34%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes118 object files changed (+41.97 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units2003 translation units recompiled, 12023 s compile time in total, 2003 of them have a recent master baseline. |
groeneai
left a comment
There was a problem hiding this comment.
Reviewed. The mechanical side of the collapse checks out: no use_conflict_detector spelling is left in src/ or tests/ (only the AUTOGENERATED_* docs regions, as the description says), the empty string as an enum value has precedent in SettingsEnums.cpp (JoinStrictness, SetOperationMode), the new toString has the same shape as its siblings in Joins.cpp, and the five tests map 1:1 per arm (_a = 1 -> 'a', _c = 1 -> 'c') with the per-file counts unchanged: 05098 5a/5c, 05099 2a/3c, 05138 1a/4c, 05182 6a/2c, 05183 6a/2c. So no query changed which detector it exercises, no .reference needed touching, and no query had both booleans set, which means the collapse had nothing ambiguous to resolve.
One thing I would settle before the old names disappear. The "never appeared in a release" premise is measured against v26.9.1.1-new, but that tag (94a1553, 2026-08-24) predates the 26.9 branch cut. The 26.9 release branch was created on 2026-09-16 from master 6e59880 (git merge-base origin/26.9 origin/master; head d1213811, VERSION_STRING 26.9.1.1), and that base already carries the settings: git show origin/26.9:src/Core/Settings.cpp has both DECLARE(Bool, query_plan_optimize_join_order_use_conflict_detector_{a,c}, ...) lines, and git show origin/26.9:src/Core/SettingsChangesHistory.cpp still lists both records under its 26.9 block. Nothing has shipped yet, v26.9.1.1-new being the only v26.9* tag, so the premise holds at this moment, but the first release cut from that branch will carry the old names, and after that a user who sets query_plan_optimize_join_order_use_conflict_detector_c = 1 in a query or a profile gets UNKNOWN_SETTING on the upgrade to 26.10, with nothing left in the history saying where the name went.
Either resolution works for me:
- Backport the rename to 26.9 too, so no released version ever sees the old names. The new setting then ships in 26.9 as well, so the
26.9block should carry a record for it next to the 26.10 one:check_settings_changes_historyinci/jobs/check_style.pyasks for the current version block "in addition to any older block used for backports". - Or leave 26.9 as it is and keep the old names as
MAKE_OBSOLETE(M, Bool, ...), with the two26.9records staying put, since that release will have shipped them.
When I renamed allow_experimental_trino_dialect in #120007, the plain no-alias rename rested on the same measurement taken against the release branches rather than the -new tag (0 occurrences in src/Core/Settings.cpp on 26.8, 26.7 and 26.6, record in the then-unreleased 26.9 block), which is also why the record was renamed in place instead of moved to another version.
| DECLARE(Bool, query_plan_optimize_join_order_use_conflict_detector_c, false, R"( | ||
| Only affects the `dpsub` join order algorithm. When enabled, DPsub decides which join reorderings | ||
| are valid using the CD-C conflict detector. Takes precedence over `query_plan_optimize_join_order_use_conflict_detector_a` when both are enabled. | ||
| DECLARE(JoinOrderConflictDetector, query_plan_optimize_join_order_conflict_detector, JoinOrderConflictDetector::NONE, R"( |
There was a problem hiding this comment.
The old names already exist on the remote 26.9 release branch, so removing both declarations here leaves no accepted spelling for users who upgrade from the first 26.9 release to 26.10: a query or profile that still sets query_plan_optimize_join_order_use_conflict_detector_a or query_plan_optimize_join_order_use_conflict_detector_c will fail with UNKNOWN_SETTING.
This needs a migration path in master, not just a renamed SettingsChangesHistory entry. The closest precedent is output_format_arrow_unsupported_types, which kept the old boolean live and translated it only while the new enum stayed at its default. Here that likely means either keeping the old names accepted and mapping them to query_plan_optimize_join_order_conflict_detector, or backporting this rename to 26.9 before its first release. MAKE_OBSOLETE would not be enough because it would silently drop the detector choice.
…/github.com/ClickHouse/ClickHouse into merge-join-order-conflict-detector-settings
Cherry pick #120630 to 26.9: Merge join-order conflict-detector settings into one enum setting
… into one enum setting
…herry-pick The cherry-pick of #120630 onto the `26.9` release branch copied the whole `addSettingsChanges(settings_changes_history, "26.10", ...)` block from `master`. That block does not belong on a release branch, and three of its entries name settings that do not exist in `26.9` at all: `iceberg_tolerate_conflicting_manifest_schemas`, `prefer_optimize_projection` and `output_format_arrow_unsupported_types`. As a result every use of the `compatibility` setting failed with `Code: 115. DB::Exception: Unknown setting 'iceberg_tolerate_conflicting_manifest_schemas'. (UNKNOWN_SETTING)`, which is what all 96 CI failures come down to: stateless tests that set `compatibility`, the `SettingsCompatibility` and `NetworkCompressionSettings` unit tests, the stress test (it exercises the settings named in the job's `settings_history_changed_settings`), and every integration test whose server config pins `compatibility` — those servers exited with code 115 at startup. The remaining entries of that block (`max_bytes_before_external_distinct`, `max_bytes_ratio_before_external_distinct`, `query_plan_optimize_join_order_conflict_detector`, `use_text_index_postings_cache`) were duplicates of rows already present in the `26.9` block, so nothing is lost by dropping it. The backport now differs from `26.9` only by replacing `query_plan_optimize_join_order_use_conflict_detector_a`/`_c` with `query_plan_optimize_join_order_conflict_detector`, which is exactly what #120630 did on `master`. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Backport #120630 to 26.9: Merge join-order conflict-detector settings into one enum setting
ClickHouse#120630 replaced the boolean `query_plan_optimize_join_order_use_conflict_detector_c` with the enum `query_plan_optimize_join_order_conflict_detector`, so after the master merge the degenerate-predicate arm failed with UNKNOWN_SETTING. The value 'c' selects the same CD-C path the old `= 1` did (`joinEnum.h` seeding block, `joinOrderDPSub.cpp`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #118413
Related: #118494
Related: #120110
query_plan_optimize_join_order_use_conflict_detector_aandquery_plan_optimize_join_order_use_conflict_detector_care replaced by a singlequery_plan_optimize_join_order_conflict_detector, takinga,c, or the empty string (the default, meaning no conflict detector).This is the naming asked for in #118413:
That issue was closed by #118494, which renamed the settings to
..._use_conflict_detector_aand_crather than collapsing them into one setting with the requested values.Two booleans could express a state the feature does not have - both detectors at once - which the documentation had to resolve with a precedence rule (
CD-C takes precedence over CD-A when both are enabled). A single value cannot be ambiguous, so the rule is gone.QueryGraph::use_conflict_detector_aand_clikewise become a singleQueryGraph::conflict_detectorof the newJoinOrderConflictDetectorenum.The old names reached 26.9 through #118494, after the branch was cut, so this is marked
v26.9-must-backport: with the backport in place no released version ever carries them. The new setting therefore ships in 26.9 as well and is recorded under the 26.9 block, next to the 26.10 one thatcheck_settings_changes_historyrequires for the current version block "in addition to any older block used for backports". Recording one setting identically in two adjacent blocks followsdistributed_cache_client_idin 26.9 and 26.8.The backport's cherry-pick conflicts on
src/Core/SettingsChangesHistory.cpp, because 26.9 has no 26.10 block; the resolution keeps only the 26.9 record.The documentation hits under
docs/reference/settings/are all insideAUTOGENERATED_START/AUTOGENERATED_ENDregions and are left to the documentation autogeneration workflow.#120110 touches the same settings and will need to adopt the new name, with its default flip becoming
query_plan_optimize_join_order_conflict_detector = 'c'.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Replaced the experimental settings
query_plan_optimize_join_order_use_conflict_detector_aandquery_plan_optimize_join_order_use_conflict_detector_cwith a single settingquery_plan_optimize_join_order_conflict_detector, which takesa,c, or the empty string (the default).Workflow [PR]
Sync PR [sync-upstream/pr/120630]
Version info
26.9.1.1623