mrhhsg opened a new pull request, #70959: URL: https://github.com/apache/doris/pull/70959
### What problem does this PR solve? Issue Number: None Related PR: #70876 Backport of #70876 to `branch-4.2`, cherry-picked from public commit `567cfa2694f5a5327e812b423672c61c5ed7efd9`. FE initializes the aggregation spill sink threshold to 64 GiB instead of 64 MiB, so BE silently caps it at 4 GiB. FE also retains out-of-range values for six spill settings, making displayed and persisted settings differ from their effective BE values. ### Changes - Correct the compiled aggregation sink default to 64 MiB. - Normalize the following settings at FE assignment and restoration boundaries, covering SESSION/GLOBAL, hints and restoration, forwarding, image JSON, job maps, and journal replay. Preserve numeric parse errors, absent-key behavior, and unrelated variables. | Variable | Inclusive range | Compiled default | |---|---|---| | `spill_hash_join_partition_count` | [2, 32] | 4 | | `spill_aggregation_partition_count` | [2, 32] | 4 | | `spill_repartition_max_depth` | [1, 128] | 8 | | `spill_buffer_size_bytes` | [1 MiB, 256 MiB] | 8 MiB | | `spill_aggregation_sink_mem_limit_bytes` | [1 MiB, 4 GiB] | 64 MiB | | `spill_sort_merge_mem_limit_bytes` | [1 MiB, 4 GiB] | 64 MiB | - Retain `branch-4.2`'s `VariableMgr.VarAttr` annotations and bilingual descriptions, share its integer-normalization entry point, and enable forwarding for both spill partition-count settings. Adapt the added tests to the branch's existing context and JUnit conventions. - Clarify that the aggregation threshold controls proactive spilling after aggregation starts spilling, not the initial spill trigger or query memory limit. The sort-merge setting derives merge fan-in rather than imposing a hard memory limit. - Include the complete spill boundary and persistence/forwarding coverage from the source change. BE algorithms, Thrift fields, and absent-field fallbacks are unchanged. ### Compatibility and behavior FE now displays and persists the bounded values used by BE. For these six settings, 0 and -1 retain their previous BE-effective lower-bound behavior. Historical 64 GiB aggregation values normalize to 4 GiB, preserving their previous effective threshold. The corrected 64 MiB compiled default applies without a restored GLOBAL override or after explicit `SET spill_aggregation_sink_mem_limit_bytes=DEFAULT`. New and reset connections still inherit GLOBAL settings. The lower default may change memory-revocation and spill-I/O frequency; explicitly setting this variable to `4294967296` retains the previous effective threshold. ### Testing Local validation on `branch-4.2`: - `DISABLE_JAVA_CHECK_STYLE=OFF FE_MAVEN_THREADS=16 bash build.sh --fe -j 16`: passed; 0 Checkstyle violations across 16 modules. - `bash run-fe-ut.sh --run org.apache.doris.qe.SessionVariableSpillContractTest,org.apache.doris.qe.VariableMgrTest`: 54 tests passed, with no failures, errors, or skips. - `bash build.sh --be -j 48`: Release build passed. - `bash run-regression-test.sh --conf "$REG_CONF" --run -d query_p0/session_variable -s test_spill_session_variable_ranges -parallel 1`: passed on an isolated local FE/BE cluster; all 78 expected-output sections matched. - `bash run-regression-test.sh --conf "$REG_CONF" --run -d spill_p0 -s aggregate_spill -parallel 1`: passed on the same cluster as a compatibility smoke test, not a threshold-performance test. - `git diff --check`: passed for the complete committed diff. `REG_CONF` denotes the isolated local regression configuration. BE unit tests, full CI, mixed-version upgrades, S3 validation, and spill-workload performance testing were not run. ### Release note Correct the compiled aggregation spill sink threshold to 64 MiB and align FE storage/display of six spill settings with existing BE bounds. Saved aggregation values retain their prior effective threshold, and restored GLOBAL settings remain authoritative for new connections. ### Check List (For Author) - [x] Unit tests - [x] Regression tests - Behavior changed: Yes, as described above. - Documentation needed: Yes, the session-variable reference should reflect the ranges and corrected aggregation default; documentation is not included in this backport. ### AI Disclosure - Tool: Codex - Generated: Code, tests, and this description. - Human review: No human review is claimed. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
