Uh oh!
There was an error while loading. Please reload this page.
branch-4.1: [fix](exec) Retain sliding window rows during eviction #67274 - #67329
Conversation
Problem Summary: Streaming `ROWS` window aggregates retain state across frame evaluations. The eviction path previously considered only whether buffered blocks had been emitted, so it could erase either the outgoing row needed by a bounded sliding frame or the next unread row needed by an `UNBOUNDED PRECEDING ... N PRECEDING` frame. After rebasing, negative partition and outgoing positions could allow a nullable aggregate to access its null map out of bounds. Evicting either kind of required row could also produce incorrect aggregate results. Root cause: `_remove_unused_rows()` did not account for the earliest row required by the next ROWS frame evaluation, and `BoundaryPose::remove_unused_rows()` allowed retained-column coordinates to become negative. This change defers block-aligned eviction when the candidate prefix contains either `frame_start - 1`, the outgoing row required by a bounded sliding update, or the next unread row required by an `UNBOUNDED PRECEDING ... N PRECEDING` frame. It also rebases partition and order boundaries to nonnegative physical-column coordinates. The BE unit coverage exercises both ROWS executors across eviction boundaries and verifies boundary rebasing. Observed ASAN failure before this change (`output/be/log/be.out`): ```text ERROR: AddressSanitizer: heap-buffer-overflow READ of size 1 #0 doris::AggregateFunctionNullUnaryInlineV2<...>::execute_function_with_incremental(...) be/src/exprs/aggregate/aggregate_function_null_v2.h:595 #1 doris::AggFnEvaluator::execute_function_with_incremental(...) be/src/exprs/vectorized_agg_fn.cpp:334 #2 doris::AnalyticSinkLocalState::_execute_for_function<true>(...) be/src/exec/operator/analytic_sink_operator.cpp:385 #3 doris::AnalyticSinkLocalState::_get_next_for_sliding_rows(...) be/src/exec/operator/analytic_sink_operator.cpp:203 #4 doris::AnalyticSinkLocalState::_execute_impl(...) be/src/exec/operator/analytic_sink_operator.cpp:358 #5 doris::AnalyticSinkOperatorX::sink_impl(...) be/src/exec/operator/analytic_sink_operator.cpp:757 SUMMARY: AddressSanitizer: heap-buffer-overflow in doris::AggregateFunctionNullUnaryInlineV2<...>::execute_function_with_incremental(...) ``` ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [ ] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
hello-stephen
commented
Aug 31, 2026
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
hello-stephen
commented
Aug 31, 2026
run buildall |
PR approved by anyone and no changes requested. |
PR approved by at least one committer and no changes requested. |
yiguolei
commented
Sep 5, 2026
run buildall |
hello-stephen
commented
Sep 5, 2026
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Sep 5, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Sep 5, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Sep 5, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
hello-stephen
commented
Sep 5, 2026
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
Uh oh!
There was an error while loading. Please reload this page.
Cherry-picked from #67274