Repository navigation
Fix: LOGICAL_ERROR in PR with aggregation in order - #95306
devcrafter wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a LOGICAL_ERROR that occurs when parallel replicas are enabled alongside the "aggregation in order" optimization. The error manifested as "Replica 1 decided to read in WithOrder mode, not in ReverseOrder" due to different read modes being selected on local vs. remote replicas caused by inconsistent filter pushdown behavior.
Changes:
- Disables the
optimize_aggregation_in_ordersetting whenparallel_replicas_local_planis enabled to prevent read mode mismatches - Adds a failpoint to detect and report read mode inconsistencies during testing
- Includes a regression test that reproduces the original error condition
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Interpreters/ClusterProxy/executeQuery.cpp | Adds logic to disable aggregation in order optimization when parallel replicas use local query plans, with appropriate logging |
| src/Storages/MergeTree/ParallelReplicasReadingCoordinator.cpp | Adds failpoint check to detect read mode mismatches between replicas for testing purposes |
| src/Common/FailPoint.cpp | Registers new failpoint for read mode validation |
| tests/queries/0_stateless/03810_pr_aggr_in_order_read_mode.sql | Adds regression test that exercises the fixed scenario |
2adc7ae to
2c902b7
Compare
|
Dear @KochetovNicolai, 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. |
|
Dear @KochetovNicolai, 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. |
|
Fixed by #98467 |
Try to fix #95524
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix for
Replica 1 decided to read in WithOrder mode, not in ReverseOrderlogical error with enabled parallel replicas and aggregation in order