Repository navigation
Conversation
This reverts commit 54b63e1.
|
Workflow [PR], commit [a88612f] Summary: ❌
AI ReviewSummaryThis PR adds mutation partition pruning from Findings❌ Blockers
Tests
ClickHouse Rules
Performance & Safety
Final Verdict
|
| addSettingsChanges(settings_changes_history, "26.4", | ||
| { | ||
|
|
||
| {"optimize_mutations_with_partition_pruning", true, true, "New setting to automatically prune partitions for mutations based on WHERE clause"}, |
There was a problem hiding this comment.
SettingsChangesHistory entry for a newly introduced setting should use the pre-feature value as previous_value to preserve old behavior under compatibility.
Here both previous_value and new_value are true, so compatibility cannot disable the new mutation partition-pruning behavior for older profiles.
Please change this entry to:
{"optimize_mutations_with_partition_pruning", false, true, "New setting to automatically prune partitions for mutations based on WHERE clause"}There was a problem hiding this comment.
I think it's a valid review and it should be "optimize_mutations_with_partition_pruning", false, true.
|
The newly added test is shown as flaky. |
| addSettingsChanges(settings_changes_history, "26.4", | ||
| { | ||
|
|
||
| {"optimize_mutations_with_partition_pruning", true, true, "New setting to automatically prune partitions for mutations based on WHERE clause"}, |
There was a problem hiding this comment.
I think it's a valid review and it should be "optimize_mutations_with_partition_pruning", false, true.
…kHouse into mutation-partition-pruning
| block_data, | ||
| *zookeeper, | ||
| affected, | ||
| block_numbers_stat.version); |
There was a problem hiding this comment.
For explicit IN PARTITION mutations, this always passes block_numbers_stat.version and retries on ZBADVERSION when any unrelated partition is created concurrently.
That version check is required for predicate-pruned mutations, but for explicit partition lists it can cause avoidable retries (and potential starvation under frequent new-partition creation) without improving ordering guarantees for the explicitly targeted partitions.
Please pass expected_block_numbers_version only for pruned mutations, e.g.:
- use
std::optional<int32_t>{block_numbers_stat.version}whenhas_pruned_commandsistrue; - use
std::nulloptfor explicit-only mutations.
|
The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix. |
LLVM Coverage Report
Changed lines: 86.38% (463/536) | lost baseline coverage: 74 line(s) · Uncovered code |
Some authors don't want this kind of automated help on their PRs. Pre- filter the involves set on `author.login` against a configurable `SKIP_AUTHORS` array (initially just `alesapin`), applied right after the backport filter so all three downstream filters (authored, assigned, taken-over) honour it. NB: the jq predicate binds `.author.login as $a` first, otherwise the subsequent `$skip | index(.author.login)` would evaluate `.author.login` against `$skip` (an array) and fail with "Cannot index array with string". Verified live: 426 involves -> 415 after both filters, with the two alesapin PRs (`#100950 Follow up changes for setting table_readonly`, `#99933 Do automatic partitions pruning for mutations when it's possible`) correctly identified for skipping. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Dear @CurtizJ, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
|
Superseded by #110968, which preserves the commits from this branch and brings the feature up to date with the current |
…-history bucket The entry was added to the 26.4 bucket when the PR was first written, but the feature lands in 26.7. Addresses the review thread on `SettingsChangesHistory.cpp` in ClickHouse#99933. Co-Authored-By: Claude Fable 5 <[email protected]>
…uning `getPartitionIdsPrunedByPredicate` analyzed the bare predicate against physical columns only and propagated any analysis exception. A mutation like `ALTER TABLE t DELETE WHERE _part = '...'` would fail with `UNKNOWN_IDENTIFIER` because virtual columns are not physical, and with `optimize_mutations_with_partition_pruning` enabled by default this would break previously working queries. Include virtual columns in the analysis and treat any analysis error as "cannot prune" (mutate all partitions, the historical behavior), since pruning is only an optimization and the mutation analyzes the predicate later with more context. Addresses the AI review on ClickHouse#99933. Co-Authored-By: Claude Fable 5 <[email protected]>
…ations For explicit `IN PARTITION` the target partition set is exact and does not depend on the observed partition list, so a partition appearing concurrently is out of scope by definition and the `ZBADVERSION` retry loop is not needed. Addresses the review thread on `StorageReplicatedMergeTree.cpp` in ClickHouse#99933. Co-Authored-By: Claude Fable 5 <[email protected]>
Some authors don't want this kind of automated help on their PRs. Pre- filter the involves set on `author.login` against a configurable `SKIP_AUTHORS` array (initially just `alesapin`), applied right after the backport filter so all three downstream filters (authored, assigned, taken-over) honour it. NB: the jq predicate binds `.author.login as $a` first, otherwise the subsequent `$skip | index(.author.login)` would evaluate `.author.login` against `$skip` (an array) and fail with "Cannot index array with string". Verified live: 426 involves -> 415 after both filters, with the two alesapin PRs (`ClickHouse#100950 Follow up changes for setting table_readonly`, `ClickHouse#99933 Do automatic partitions pruning for mutations when it's possible`) correctly identified for skipping. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Now ClickHouse do automatic partition pruning for mutation queries based on
WHEREpart of query. Also now it's possible to specify multiple partitions inIN PARTITIONclause. Fixes #98739.Documentation entry for user-facing changes
This PR is made with help of Claude Code.