Repository navigation
Commit 097b15b
[fix](fe) Forward four local exchange session variables to the master
### What problem does this PR solve?
Issue Number: None
Related PR: #69273, #70177
Problem Summary: A statement that has to run on the master FE (INSERT
INTO ... SELECT, CTAS, ...) and arrives at a follower or an observer is
forwarded with the session variables that
`SessionVariable#getForwardVariables()` sends, and the master applies
them to a session that starts from its own global variables. Only
variables whose `@VarAttr` sets `needForward` are sent. #69273 flagged
the planner and executor variables, `enable_local_exchange_before_agg`
among them, but not four that also decide the local exchanges of a plan:
`enable_local_exchange_before_streaming_agg` (a local hash exchange
before a streaming pre-aggregation, BE `StreamingAggOperatorX` and the
FE planner with #70177), `enable_streaming_agg_hash_join_force_passthrough`
and `enable_distinct_streaming_agg_force_passthrough` (a passthrough
local exchange below a streaming pre-aggregation, FE `AggregationNode`
and the BE operators), and `force_to_local_shuffle` (every scan serial,
`ScanNode#isSerialNode`). A session-level SET of one of them was dropped
when the statement was forwarded, so the master planned it with its
global value and EXPLAIN on the follower showed a plan the master did
not run. Results do not change, only the plan and its speed. The four
now set `needForward = true`, as #69273 does for the others.
### Release note
The session variables enable_local_exchange_before_streaming_agg,
enable_streaming_agg_hash_join_force_passthrough,
enable_distinct_streaming_agg_force_passthrough and
force_to_local_shuffle now apply to statements that a follower or
observer FE forwards to the master.
### Check List (For Author)
- Test: Unit Test
- `SessionVariablesTest#testForwardPlanAndExecutionKnobs` lists the
four; with `SessionVariable.java` reverted it fails. The test
classes that call `getForwardVariables()` or
`setForwardedSessionVariables()` pass, and fe-core Checkstyle
reports nothing. Not run on a cluster with two FEs.
- Behavior changed: Yes. A forwarded statement uses the session's value
of these four variables instead of the master's global value.
- Does this need documentation: No
Co-Authored-By: Claude Opus 5.5 <[email protected]>1 parent 0eb5131 commit 097b15b
2 files changed
Lines changed: 9 additions & 6 deletions
File tree
- fe/fe-core/src
- main/java/org/apache/doris/qe
- test/java/org/apache/doris/qe
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
| 1454 | + | |
1455 | 1455 | | |
1456 | 1456 | | |
1457 | 1457 | | |
1458 | 1458 | | |
1459 | 1459 | | |
1460 | | - | |
| 1460 | + | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | | - | |
| 1463 | + | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
| |||
1777 | 1777 | | |
1778 | 1778 | | |
1779 | 1779 | | |
1780 | | - | |
| 1780 | + | |
1781 | 1781 | | |
1782 | 1782 | | |
1783 | 1783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
567 | 568 | | |
568 | | - | |
| 569 | + | |
| 570 | + | |
569 | 571 | | |
570 | 572 | | |
| 573 | + | |
571 | 574 | | |
572 | | - | |
| 575 | + | |
573 | 576 | | |
574 | 577 | | |
575 | 578 | | |
| |||
0 commit comments