Repository navigation
Make the setting allow_experimental_reverse_key obsolete - #106440
Conversation
Descending sort order in `MergeTree` sorting keys (`ORDER BY` with `DESC`) used to be gated behind the experimental table-level setting `allow_experimental_reverse_key`. The feature is now always supported, so the setting is made obsolete (kept as a no-op for backward compatibility, so old DDL that sets it keeps working) and the gating code is removed: - `allow_experimental_reverse_key` moved to the obsolete settings list via `MAKE_OBSOLETE_MERGE_TREE_SETTING`, with a matching entry in `SettingsChangesHistory`. - Removed the `allow_reverse_key` member, the `allow_reverse_sorting_key` parameter of `checkProperties`, and the validation branch that rejected reversed sorting keys. - Stopped randomizing the obsolete setting in the query fuzzer and BuzzHouse. Added a stateless test that checks a descending sort key works without any setting, that the obsolete setting is still accepted, and that it is reported as obsolete in `system.merge_tree_settings`. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [95a29de] Summary: ✅
AI ReviewSummaryThis PR makes descending Findings
Final VerdictStatus: Minimum required action: add user-facing documentation for descending |
Making `allow_experimental_reverse_key` obsolete does not change its default value (`false`), so there is no value change to record. The `merge_tree_settings_changes_history` records new settings and value changes, not tier-only obsolescence — most obsolete `MergeTree` settings (e.g. `write_final_mark`, `min_bytes_for_compact_part`, `cleanup_threads`) have no history entry. The `02995_new_settings_history` check does not require one either, since the setting is neither new nor value-changed. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| MAKE_OBSOLETE_MERGE_TREE_SETTING(M, UInt64, kill_delay_period_random_add, 10) \ | ||
| MAKE_OBSOLETE_MERGE_TREE_SETTING(M, UInt64, kill_threads, 128) \ | ||
| MAKE_OBSOLETE_MERGE_TREE_SETTING(M, UInt64, cleanup_threads, 128) \ | ||
| MAKE_OBSOLETE_MERGE_TREE_SETTING(M, Bool, allow_experimental_reverse_key, false) \ |
There was a problem hiding this comment.
Making allow_experimental_reverse_key obsolete removes the only source-level documentation I can find for descending MergeTree sorting keys. The current MergeTree docs describe ORDER BY expr, but they do not mention that table sorting keys now accept DESC or show the natural ORDER BY (time DESC, key) pattern this PR is graduating.
Please add a short note/example to the MergeTree ORDER BY documentation (or another user-facing source doc) so the always-on syntax is discoverable after this setting becomes a generic obsolete no-op.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 30/31 (96.77%) | Lost baseline coverage (was covered on master, now uncovered in this PR): 7 line(s) · Uncovered code |
Algunenano
left a comment
There was a problem hiding this comment.
LGTM.
It would be great to introduce some fuzzing around this feature since right now it's only a gate and randomizing it won't use the code or trigger possible correctness bugs. cc @PedroTadim
Closes: #103677
Descending sort order in
MergeTreesorting keys (ORDER BYwithDESC, e.g.ORDER BY (time DESC, key)) used to be gated behind the experimental table-level settingallow_experimental_reverse_key. The feature has been available and covered by tests for a while, so this PR graduates it to always-on and makes the setting obsolete.The obsolete setting is kept as a no-op for backward compatibility, so existing DDL and table metadata that set
allow_experimental_reverse_key = 1keep working. The now-dead gating code is removed: theallow_reverse_keymember, theallow_reverse_sorting_keyparameter ofcheckProperties, and the validation branch that rejected reversed sorting keys. The setting is also no longer randomized by the query fuzzer and BuzzHouse.No
SettingsChangesHistoryentry is added: the setting's default value does not change (false), and theMergeTreesettings history records new settings and value changes rather than tier-only obsolescence (consistent with existing obsoleteMergeTreesettings such aswrite_final_markorcleanup_threads).A new stateless test (
04312_reverse_key_obsolete_setting) verifies that a descending sort key works without any setting, that the obsolete setting is still accepted, and that it is reported as obsolete insystem.merge_tree_settings.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Descending sort order in
MergeTreesorting keys (e.g.ORDER BY (time DESC, key)) is now always supported and no longer requires the experimental settingallow_experimental_reverse_key, which became obsolete.Documentation entry for user-facing changes
MergeTreesettings reference is generated from the source, and the feature itself is already documented.🤖 Generated with Claude Code
Version info
26.6.1.553