Skip to content

branch-4.1: [fix](runtime-filter) Restore _applied_rf_num update in late arrival path #62872#62971

Merged
yiguolei merged 1 commit intobranch-4.1from
auto-pick-62872-branch-4.1
May 1, 2026
Merged

branch-4.1: [fix](runtime-filter) Restore _applied_rf_num update in late arrival path #62872#62971
yiguolei merged 1 commit intobranch-4.1from
auto-pick-62872-branch-4.1

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Cherry-picked from #62872

…path (#62872)

### What problem does this PR solve?

Related PR: #59786

Problem Summary: PR #59786 (commit e78d089) refactored
`Scanner::try_append_late_arrival_runtime_filter()` and accidentally
removed the trailing `_applied_rf_num = arrived_rf_num;` assignment. As
a result `_applied_rf_num` is permanently 0 after construction:

* the fast-path `_applied_rf_num == _total_rf_num` early return at the
top of the function never fires, so every batch goes through the full
late-arrival check;
* `arrived_rf_num == _applied_rf_num` only short-circuits when no
runtime filter has ever arrived. Once any RF arrives, every subsequent
call needlessly `_conjuncts.clear()`s, re-clones the conjunct ctxs and
appends the old ones into `_stale_expr_ctxs` — wasted CPU plus slow
memory growth;
* the `ApplyAllRuntimeFilters=True` info string in scanner profile
(`file_scanner.cpp:384`) is never emitted;
* `DCHECK(_applied_rf_num < _total_rf_num)` is effectively dead because
the left-hand side is always 0.

Restore the single missing assignment after cloning the new conjunct
ctxs.

### Release note

None

### Check List (For Author)

- Test: No need to test (one-line restoration of removed assignment;
behavior covered by existing runtime-filter regression tests)
- Behavior changed: No
- Does this need documentation: No

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot requested a review from yiguolei as a code owner April 30, 2026 07:10
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen
Copy link
Copy Markdown
Contributor

run buildall

@yiguolei
Copy link
Copy Markdown
Contributor

yiguolei commented May 1, 2026

skip buildall

@yiguolei yiguolei merged commit 50ccddd into branch-4.1 May 1, 2026
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants