Skip to content

branch-incremental-computation: pick the merged incremental-computation PRs from master in merge order (#68138) - #68303

Merged
morningman merged 1 commit into
apache:branch-incremental-computationfrom
morningman:auto-pick-batch-20260921-branch-incremental-computation
Sep 21, 2026
Merged

morningman merged 1 commit into
apache:branch-incremental-computationfrom
morningman:auto-pick-batch-20260921-branch-incremental-computation

Conversation

@morningman

Copy link
Copy Markdown
Contributor

Cherry-picked from #68138

Batch pick of every merged PR carrying the incremental-computation label that branch-incremental-computation does not have yet (no incremental-computation-picked label), in the order they landed on master (git log --first-parent). One commit per PR, each ending with (cherry picked from commit <master sha>). Follows the same convention as #67830, #68017, #68073, #68151 and #68236. This round has a single PR.

# Master commit PR Title
1 695c88b #68138 fix Refresh incremental partition versions before pruning

Not included on purpose:

  • The 28 labelled PRs that already carry incremental-computation-picked (every other closed PR with the label).

Prerequisite check

Drift check against master

  • RowBinlogTableWrapper.java, OlapTableWrapperTest.java and the new PruneEmptyPartitionTest.java are byte-identical to master at 695c88b5772.
  • CloudPartition.java differs from master only by the unlabelled [improvement](fe) Reduce cloud version sync config #66296 ("Reduce cloud version sync config": the maxAttempts overload of getSnapshotVisibleVersionFromMs / getSnapshotVisibleVersion and the VariableMgr.getDefaultSessionVariable() fallback for cloudPartitionVersionCacheTtlMs). Applying [improvement](fe) Reduce cloud version sync config #66296's hunks for this file on top of the branch in a temporary index gives a zero-line diff against master, so nothing of the pick is missing; the pick itself only calls the two-argument getSnapshotVisibleVersionFromMs(partitions, false), which is the same on both sides. [improvement](fe) Reduce cloud version sync config #66296 stays out, as in the previous rounds.

Verification

  • FE: run-fe-ut.sh --run on this branch (regenerates thrift/protobuf, compiles fe-core main + test) with the two touched test classes plus every test class that exercises selectNonEmptyPartitionIds / getSnapshotVisibleVersionFromMs / RowBinlogTableWrapper: 8 classes, 108 tests, 0 failures, 0 errors, BUILD SUCCESS — CloudGlobalTransactionMgrTest 37, ExplainTableStreamPlanTest 24, PhysicalPlanTranslatorTest 17, OlapScanNodeTest 12, PartitionCompensatorTest 12, OlapTableWrapperTest 4 (the two new tests included), PruneEmptyPartitionTest 1 (new), TableBinlogFunctionAuthTest 1. The @Test counts of the two touched classes equal master's.
  • FE checkstyle on fe-core: 0 violations.
  • No BE, cloud or regression-suite changes in this PR.

…pache#68138)

### What problem does this PR solve?

Issue Number: None

Related PR: apache#67181

Problem Summary:

A cloud incremental read may wait for its target transaction to become
visible before query planning continues. During that wait, the FE
`CloudPartition` cache can still contain `PARTITION_INIT_VERSION` for a
partition even though the transaction has already become visible in
MetaService.

`PruneEmptyPartition` previously relied only on that cached version. It
could therefore classify the partition as empty and remove it before
scan-node planning. The later version refresh in
`ScanNode.setVisibleVersionForOlapScanNodes` could observe the new
version, but it was already too late because the partition had been
pruned from the scan.

This PR changes empty-partition pruning for direct cloud incremental
reads as follows:

- A partition that is already known to be non-empty from the FE cache is
retained directly. Partition versions are monotonic, so a cached version
greater than `PARTITION_INIT_VERSION` remains sufficient for this
pruning decision.
- Only cached-empty or unknown candidate partitions are refreshed from
MetaService. This catches transactions that became visible after the FE
cache entry was populated while avoiding unnecessary RPC work for known
non-empty partitions.
- The refreshed and cached results are combined in the original
candidate-partition order.
- Normal reads and incremental reads backed by an `OlapTableWrapper`
with fixed visible versions continue to use their existing
snapshot-aware path.

The refresh in `ScanNode.setVisibleVersionForOlapScanNodes` is
intentionally retained. `PruneEmptyPartition` only needs an
empty-or-non-empty decision, while scan execution still needs the exact
snapshot versions of all final selected partitions.

### Release note

Fix cloud incremental reads that could miss newly visible data because a
stale FE partition-version cache caused premature empty-partition
pruning.

### Check List (For Author)

- Test
    - [ ] Regression test
    - [x] Unit Test
        - `PruneEmptyPartitionTest`
        - `OlapScanNodeTest`
    - [ ] 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

- Behavior changed:
    - [ ] No.
- [x] Yes. Direct cloud incremental reads refresh cached-empty or
unknown partition versions from MetaService before empty-partition
pruning.

- Does this need documentation?
    - [x] No.
    - [ ] Yes.

### Check List (For Reviewer who merge this PR)

- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label

(cherry picked from commit 695c88b)
@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?

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman
morningman merged commit 71679ac into apache:branch-incremental-computation Sep 21, 2026
24 of 26 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