[improvement](be) Prune rowsets by TSO before row binlog scans - #68012
Merged
morningman merged 1 commit intoSep 16, 2026
Merged
morningman merged 1 commit into
morningman merged 1 commit into
Conversation
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
Author
|
/review |
### What problem does this PR solve?
Issue Number: None
Problem Summary: Bounded ROW binlog queries initialize readers and open segment
footers for historical rowsets before their TSO predicates can reject them.
Initialization work therefore grows with retained history even for narrow windows.
After capturing a version-consistent read source, remove rowsets whose inclusive
commit TSO range cannot intersect the query's half-open interval. For example,
rowset [10,99] is excluded from query [100,200). Preserve unknown TSO metadata,
overlapping compaction output, and separately captured delete predicates.
Skip scanners when only empty rowsets remain so an empty source is not recaptured.
Expose pruning time and rowset, segment, and tablet counts in the query profile.
### Release note
Reduce reader initialization and segment footer IO for bounded ROW binlog queries.
### Check List (For Author)
- Test: Unit Test / Regression test / Manual test
- ASAN BE and FE build completed with build.sh.
- 8 OlapScanOperatorTsoPruningTest and OlapScanOperatorBinlogPushDownTest tests passed.
- test_binlog_rowset_tso_pruning and test_binlog_changes_syntax passed.
- Generated the new regression output and reran it in comparison mode.
- An empty-window profile pruned 2 rowsets / 2 segments and created 0 scanners.
- clang-format 16, header hygiene, and clang-tidy passed.
- Behavior changed: No (query results are unchanged; profile counters are added)
- Does this need documentation: No
HappenLee
force-pushed
the
improvement/rowset-tso-pruning
branch
from
September 15, 2026 09:23
cb73d23 to
93a3cec
Compare
HappenLee
requested review from
924060929,
CalvinKirs,
dataroaring,
englefly,
gavinchou,
liaoxin01,
luwei16,
morningman,
morrySnow,
mymeiyi,
starocean999,
yiguolei and
yujun777
as code owners
September 15, 2026 09:23
HappenLee
changed the base branch from
master
to
branch-incremental-computation
September 15, 2026 09:24
Contributor
|
Codex automated review failed and did not complete. Error: Codex completed, but no new pull request review was submitted for the current head SHA. Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
morningman
merged commit Sep 16, 2026
6f7c87f
into
apache:branch-incremental-computation
20 of 22 checks passed
12 tasks
morningman
added a commit
that referenced
this pull request
Sep 16, 2026
…on PRs from master in merge order (#65805 #67813) (#68073) Cherry-picked from #65805, #67813 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 created with `git cherry-pick -x` so the message ends with `(cherry picked from commit <master sha>)`. Follows the same convention as #67830 and #68017. | # | Master commit | PR | Title | |---|---|---|---| | 1 | ec886f3 | #65805 | [fix](nereids) Disambiguate NULL/OFFSET metadata from same-named nested fields | | 2 | 3dbe4d3 | #67813 | [fix](cloud) Invalidate version caches on visible commit retries | Not included on purpose: - The 17 labelled PRs that already carry `incremental-computation-picked` (#62606 in the fork point, #67508 via #67712, the nine of #67830, the six of #68017). - #68012 carries the label but is a PR against this branch itself (merged as `6f7c87fa892`); nothing to pick. - #67820 is still open on master; this branch already carries its content via #67861. ### Prerequisite check - **#65805** lists #65591 and #66380 as related PRs: #65591 is still open and #66380 was closed unmerged, both superseded by #65805 itself. The nested-column-pruning series it builds on (#59263, #61888, #64535) is before the fork point, so it is already on this branch. No master commit between the fork point and #65805 touches `column_reader.{cpp,h}`, `descriptors.cpp`, the nereids pruning rules or the BE tests. The only overlap is the unrelated #66761 (TIMESTAMP_NS), which touches `Descriptors.thrift` (a different struct) and adds an unrelated test plus its `Config` import to `DescriptorToThriftConverterTest.java`; that caused the one conflict, see below. - **#67813** declares no related PR (closes #67099). Its behavior does not depend on any master commit missing here. The one unlabelled master commit that touches the same main files, #66296 ("Reduce cloud version sync config"), only adds `maxAttempts` overloads that none of #67813's main-code hunks use. The other drift in `CloudGlobalTransactionMgr.java` / `CloudGlobalTransactionMgrTest.java` is this branch's own #67861 (the branch-side version of the still-open #67820), which lives in `commitTxn` / `releaseFinishedTso` / `afterAbortTxnResp` and does not intersect the two hunks #67813 adds (`checkTransactionStateBeforeCommit` and the empty-partition-list branch of the commit response handling). Neither #66761 nor #66296 was picked; three mechanical adaptations were needed instead, each recorded in the pick's commit message: - **#65805** conflicted only in the import block of `DescriptorToThriftConverterTest.java` (the master hunk sits next to the `Config` import that #66761 added). Resolved by adding only `import org.apache.doris.thrift.DescriptorsConstants;`. Everything else is byte-identical to the master commit. - **#67813** conflicted only in the import block of `CloudGlobalTransactionMgrTest.java`: the branch already has `import org.apache.doris.rpc.RpcException;` through #67861, so that line became context; the other ten imports were taken as-is. - **#67813**, test-only: the master helper `mockVersionHelper()` stubs `VersionHelper.getVersionFromMeta(request, maxAttempts)`, an overload that only exists on master because of #66296, so `fe-core` test compilation failed (`method getVersionFromMeta ... cannot be applied to given types`). On this branch every read goes through the single-argument overload, so the helper now just returns `Mockito.mockStatic(VersionHelper.class)`. No main-code hunk of #67813 uses the `maxAttempts` overloads. ### Drift check against master For each pick, the diff of the touched files against the master commit's parent before the pick and against the master commit after the pick have identical `+`/`-` lines (only the import context lines differ as described above), i.e. each pick added exactly its master hunks. Leftover differences to master after the picks are: - #65805's files: `DescriptorToThriftConverterTest.java` and `Descriptors.thrift` differ from master by exactly #66761's hunks. - #67813's files: `OlapTable.java`, `CloudPartition.java`, `CloudGlobalTransactionMgr.java` and `CloudGlobalTransactionMgrTest.java`. Applying #66296 forward and #67861 in reverse in a temporary index brings the four main files to zero diff against master `3dbe4d3ca53`; the test file's remaining difference is the `RpcException` import overlap plus the `mockVersionHelper()` adaptation. `CloudFEVersionSynchronizer.java` is byte-identical to master. ### Verification - FE: `run-fe-ut.sh --run` on this branch (regenerates thrift/protobuf, compiles fe-core main + test) with the test classes touched by the picks plus the two related cloud version-cache classes: 5 classes, 139 tests, 0 failures, 0 errors, BUILD SUCCESS (2:12 min) — `PruneNestedColumnTest` 61, `DescriptorToThriftConverterTest` 21, `CloudGlobalTransactionMgrTest` 37 (all 13 tests #67813 adds included), `CloudPartitionTest` 3, `OlapTableTest` 17. (`VersionHelperTest` from #67813's checklist does not exist on this branch; #66296 added it.) - FE checkstyle on fe-core: 0 violations. - BE: `-fsyntax-only` with the flags of the Release build (`compile_commands.json`, regenerated `gen_cpp` headers) passes for `storage/segment/column_reader.cpp`, `runtime/descriptors.cpp`, and with `-DBE_TEST -fno-access-control` for `test/storage/segment/column_reader_test.cpp` and `test/runtime/descriptor_test.cpp`. - The three touched groovy suites (`lambda_null_pruning`, `left_join_not_null_column`, `null_column_pruning`) parse cleanly (groovy parser check). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: minghong <zhouminghong@selectdb.com> Co-authored-by: Luwei <814383175@qq.com>
morningman
pushed a commit
that referenced
this pull request
Sep 16, 2026
### What problem does this PR solve? Issue Number: None Related PR: #68012 (merged into `branch-incremental-computation`); this PR ports the same change to `master`. Problem Summary: Bounded ROW binlog queries initialize rowset readers and open segment footers before their TSO predicates reject historical data. A narrow time window can therefore pay initialization costs proportional to the retained history. Prune the captured read source before cloning readers or creating scanners. For query `[100, 200)`, a rowset with inclusive commit TSO range `[10, 99]` can be skipped using its metadata alone. - Preserve rowsets with unknown TSO endpoints and those that overlap the query window, including compacted rowsets. Existing segment/row predicates handle the remaining data. - Preserve the captured visible-version snapshot and separately captured delete predicates. - Skip a tablet when only empty rowsets remain, including bootstrap rowsets with no TSO. This also prevents a fully pruned source from being recaptured during scanner initialization. - Add `RowsetTsoPruneTime`, `RowsetsPrunedByTso`, `SegmentsPrunedByTso`, and `TabletsPrunedByTso` to the query profile. The filtering uses `std::erase_if` on the existing rowset vector and `std::all_of` for the empty-tablet check. It adds no storage-format or protocol changes.
morningman
added a commit
that referenced
this pull request
Sep 18, 2026
…on PRs from master in merge order (#67783 #68034 #68033 #68057 #68094 #68087) (#68151) Cherry-picked from #67783, #68034, #68033, #68057, #68094, #68087 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 created with `git cherry-pick -x` so the message ends with `(cherry picked from commit <master sha>)`. Follows the same convention as #67830, #68017 and #68073. | # | Master commit | PR | Title | |---|---|---|---| | 1 | e545b13 | #67783 | [fix](policy) Enforce row policies on MOW time travel | | 2 | f7a0842 | #68034 | [fix](binlog) Fix missing DELETE events in row binlog | | 3 | e85575e | #68033 | [fix](binlog) Preserve row binlog compaction policy | | 4 | 21160d7 | #68057 | [fix](binlog) Decouple row binlog compaction from CCR binlog config | | 5 | 04aa5a1 | #68094 | [fix](binlog) Persist row binlog config updates in cloud mode | | 6 | da8feed | #68087 | [fix](binlog) Report streams with missing base tables as stale | Not included on purpose: - The 20 labelled PRs that already carry `incremental-computation-picked` (#62606 in the fork point, #67508 via #67712, the nine of #67830, the six of #68017, the two of #68073, and #68050 whose content this branch got directly through #68012). - #68012 carries the label but is a PR against this branch itself (merged as `6f7c87fa892`); nothing to pick. - #67820 is still open on master; this branch already carries its content via #67861. ### Prerequisite check For every pick I listed the master commits between the fork point (`efedf10c7e3`) and the pick that touch the same files and are not on this branch, and checked whether the pick's behavior depends on them. - **#67783** declares no related PR. It builds on the MOW time-travel rewrite (`BindRelation.buildMowTimeTravelUnion`, #67480) which is already here. Two unlabelled master commits overlap: #66770 (authorization plugin SPI: reworks the data-mask / row-filter API of `LogicalCheckPolicy` and its test) and #67811 (removes the `isPlayNereidsDump()` check in `CheckPolicy`). Neither is a functional prerequisite: the fix consists of `getPolicyTable()` unwrapping `OlapTableWrapper`, `CheckPolicy` collecting the whole filter chain below the policy mask, and `BindRelation` putting a `LogicalCheckPolicy` above each union branch — none of that uses the #66770 API. Not picked; adapted instead (see below). - **#68034**, **#68033**, **#68087** (#68087 relates to #67173, which is before the fork point): no unpicked master commit touches any of their files; the picks applied cleanly and are byte-identical to master. - **#68057**: only `be/test/cloud/cloud_compaction_test.cpp` overlaps with the unrelated #67972 (refresh tablet meta of continuously ingested tablets); auto-merged, the pick only adds new `TEST_F` blocks. Main-code hunks are byte-identical to master. - **#68094**: overlaps with #68090 / #67972 / #66598 (`cloud_tablet.cpp`), #67295 / #67618 / #68090 (`base_tablet.{h,cpp}`), #66598 / #67637 (`meta_service.cpp`), #66598 (`cloud.proto`, `cloud_tablet_test.cpp`) and #67761 / #66598 / #67637 (`meta_service_test.cpp`). All auto-merged. The fix — `BaseTablet::binlog_config()` under the meta lock, `BinlogConfig::operator==`, `CloudTablet::sync_meta()` refreshing the binlog config, `update_tablet` in the meta service accepting `binlog_config`, and `CloudSchemaChangeHandler` routing ROW-binlog property updates through it — does not use anything those commits add. Its hunks are byte-identical to master except one trailing context line in `sync_meta()` (`last_sync_tablet_meta_time_s` comes from #67972). Only #67783 needed adaptation, recorded in its commit message: - `LogicalCheckPolicy.java`: the conflicting context was master's `parsePolicyExpression()` helper (#66770), which does not exist here; the new `getPolicyTable()` is inserted in the same place without it. - `CheckRowPolicyTest.java`: the data-mask mock is written against this branch's per-column `AccessControllerManager.evalDataMaskPolicy(..., column) -> Optional<DataMaskPolicy>` instead of master's `evalDataMaskPolicies(..., Set<String>) -> Map<String, DataMaskSpec>`. The masks are the same (concat for the random-distribution table; the non-movable `k2` mask plus identity masks for the hidden reconstruction columns of the MOW table). The master-only `Or` import (#66770) is not carried; `Collections` / `Locale` imports were added because they arrive with #66770 on master. ### Drift check against master Each pick's `+`/`-` lines are identical to the master commit's, except for the #67783 adaptation above. After the six picks, the touched files still differ from master at `da8feed859d` in: `cloud_tablet.cpp`, `base_tablet.{h,cpp}`, `cloud_compaction_test.cpp`, `cloud_tablet_test.cpp`, `meta_service.cpp`, `meta_service_test.cpp`, `cloud.proto`, `CheckPolicy.java`, `LogicalCheckPolicy.java`, `CheckRowPolicyTest.java`. Replaying the nine unpicked master commits listed above (#67637, #67618, #66770, #66598, #67972, #67811, #67761, #67295, #68090) in a temporary index and removing this branch's own #67861 (`GetTsoRecoveryTransactions` in `cloud.proto` / `meta_service_test.cpp`) brings every file to zero diff against master, except the two `LogicalCheckPolicy.java` / `CheckRowPolicyTest.java` hunks of #66770 that overlap the adaptation. Nothing else is left over. ### Verification - FE: `run-fe-ut.sh --run` on this branch (regenerates thrift/protobuf, compiles fe-core main + test) with the test classes touched by the picks plus `DeleteFromCommandTest` from #68034's checklist: 5 classes, 58 tests, 0 failures, 0 errors, BUILD SUCCESS — `CheckRowPolicyTest` 9 (the three tests #67783 adds included), `ExplainTableStreamPlanTest` 24, `CloudSchemaChangeHandlerTest` 18 (the tests of #68033 and #68094 included), `DropTableStreamTest` 5, `DeleteFromCommandTest` 2. - FE checkstyle on fe-core: 0 violations. - BE: `-fsyntax-only` with the flags of the Release build (`compile_commands.json`, regenerated `gen_cpp` headers incl. the new `TabletMetaInfoPB.binlog_config`) passes for `cloud/cloud_tablet.cpp`, `cloud/cloud_storage_engine.cpp`, `storage/olap_server.cpp`, `storage/tablet/tablet.cpp`, `storage/tablet/base_tablet.cpp`, and with `-DBE_TEST -fno-access-control` for `test/cloud/cloud_compaction_test.cpp`, `test/cloud/cloud_tablet_test.cpp`, `test/storage/compaction/compaction_task_test.cpp`, `test/storage/tablet/tablet_test.cpp`. - Meta service: the two-line `update_tablet` hunk of #68094 only uses the generated `TabletMetaInfoPB::has_binlog_config()/binlog_config()` and `TabletMetaCloudPB::mutable_binlog_config()` accessors, all present in the regenerated headers. - The two new groovy suites (`row_binlog_p0/test_row_binlog_mow_light_delete`, `time_travel_p0/test_mow_time_travel_row_policy`) parse cleanly (groovy parser check). --------- Co-authored-by: morrySnow <zhangwenxin@selectdb.com> Co-authored-by: Luwei <814383175@qq.com>
morningman
added a commit
that referenced
this pull request
Sep 20, 2026
…on PRs from master in merge order (#67820 #68088) (#68236) Cherry-picked from #67820, #68088 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 and #68151. | # | Master commit | PR | Title | |---|---|---|---| | 1 | 44e3ae2 | #67820 | [fix](binlog) Track committed TSO and fence uncertain commits for bounded incremental reads | | 2 | 3de3a75 | #68088 | [fix](binlog) Require SELECT privilege for binlog TVF | Not included on purpose: - The 25 labelled PRs that already carry `incremental-computation-picked`. - #68012 carries the label but is a PR against this branch itself (merged as `6f7c87fa892`); nothing to pick. ### How #67820 was picked This branch already carried #67820 through #67861, which backported the PR's first seven commits (up to `17272039558`) before the PR was merged. Between that cut and the merge the PR gained six more commits and five master merges, and the final design differs from what #67861 brought: the Meta Service recovery RPC (`get_tso_recovery_transactions`) and the FE startup/periodic recovery scan are gone, replaced by a durable per-instance commit-TSO fence (`txn_tso_fence_key`, `advance_tso_fence`, commit-time `TXN_COMMIT_TSO_EXPIRED` check, `enable_check_commit_tso_fence`), plus the review-feedback and "release maybe-committed TSO" fixes. A plain `cherry-pick -x 44e3ae2` conflicts in 23 files because the branch holds the intermediate design, so commit 1 was built by replaying, on top of the branch, exactly what the PR gained after the cut: - the PR's later commits `d16e67197b2`, `e53291d196b`, `864546d5531`, `8c55eb086e9`, `8d264ce294a`, `fc4f9969202`; - the content that landed inside its master merges, identified by diffing each merge against its `git merge-tree` automerge result: `c491a293426` (`setEnvTSOService` replaced by `Mockito.doReturn(tsoService).when(masterEnv).getTSOService()` — `masterEnv` is the same Mockito delegating mock here since #67813) and `29f133584b5` (the extra `TSOTransactionTrackerTest` coverage and two comment removals in `DorisFlightSqlProducer`). The other three merges only resolved import blocks against master-only code. The replay then got squashed into one commit with the master PR's message, the original author, and the `(cherry picked from commit 44e3ae2)` trailer. Adaptations, all recorded in the commit message: - `DorisFlightSqlProducer` / `DorisFlightSqlProducerTest` stay under `service/arrowflight` (the branch lacks the package move of #67866). - `8d264ce294a` is a no-op here: it removes a `catch (FlightRuntimeException)` block that #67883 added on master and this branch never had. - The branch-only `get_tso_recovery_transactions` RPC, its recovery scan, the five `TsoRecovery*` Meta Service tests and the NOLINT suppressions #67861 had added for them are removed, as on master. - The round-3 `mockVersionHelper()` adaptation in `CloudGlobalTransactionMgrTest` (no `VersionHelper.getVersionFromMeta(req, maxAttempts)` overload here, #66296) is kept. ### Prerequisite check - **#67820** declares #67181 and #67594 as related; #67181 (`e5a4e725fac`) is before the fork point and #67594 came with #67830. The rest of what the commit touches on master is import-block and neighbouring-code drift from unlabelled commits (#67866 / #67883 / #67966 Arrow Flight and session refactors, #67761 `get_prepare_txn_by_coordinator`, #66598 pre-rowset delete bitmaps, repair-tablet-index changes); none of it is used by the fence/committed-TSO logic. - **#68088** declares no related PR. The hook it implements (`TableValuedFunctionIf.checkAuth`) and the caller chain (`CheckPrivileges.visitLogicalTVFRelation` → `TableValuedFunction.checkAuth` → catalog function) are byte-identical between this branch and master, and the five-argument `AccessControllerManager.checkTblPriv` overload exists. Applied cleanly. ### Drift check against master - **#67820**: every one of the 54 files the master commit touches now contains the pick's content — the master commit reverse-applies cleanly per file onto this branch (50 files), and the four files where only the surrounding context differs (`config.h`, `meta_service_txn.cpp`, `StmtExecutor.java`, `StmtExecutorTest.java`) contain every added line and none of the removed ones. 33 of the 54 files are byte-identical to master at `44e3ae2b951`, including all of `fe/.../tso/`, `CloudGlobalTransactionMgr.java`, `MetaServiceProxy.java`, `keys.{h,cpp}`, `meta_service.h` and the regression suite/output. The remaining differences are unrelated master-only or branch-only code from unlabelled commits (#67761, #66598, #67866/#67883/#67966, repair-tablet-index, meta-cache columns, recycler configs) plus the documented `mockVersionHelper()` adaptation; no line in the committed-TSO/fence domain is left over from #67861. - **#68088**: all three files are byte-identical to master at `3de3a756f74`. ### Verification - FE: `run-fe-ut.sh --run` on this branch (regenerates thrift/protobuf, compiles fe-core main + test) with every test class the picks touch: 12 classes, 175 tests, 0 failures, 0 errors, BUILD SUCCESS — `TSOServiceTest` 38, `CloudGlobalTransactionMgrTest` 37, `StmtExecutorTest` 27, `MetaServiceProxyTest` 22, `OlapScanNodeTest` 12, `TimeBasedChangeVisibleWaiterTest` 12, `TSOTransactionTrackerTest` 9 (the four tests added inside the PR's last master merge included), `DorisFlightSqlProducerTest` 7, `TsoStatusMetadataGeneratorTest` 5, `CloudCommittedTsoTest` 3, `SchemaTableTest` 2, `TableBinlogFunctionAuthTest` 1 (#68088). The `@Test` counts of the touched classes equal master's. - FE checkstyle on fe-core: 0 violations. - Meta Service: `-fsyntax-only` with the flags of `cloud/CMakeLists.txt` (`-Wall -Werror`, regenerated `gen_cpp/cloud.pb.h` with `AdvanceTsoFence*` / `TxnTsoFencePB` and without `GetTsoRecoveryTransactions*`) on `meta_service_txn.cpp`, `keys.cpp`, `http_encode_key.cpp`, `bvars.cpp` and, with `-DUNIT_TEST -DBE_TEST -fno-access-control`, on `meta_service_test.cpp`, `keys_test.cpp`, `http_encode_key_test.cpp`, `meta_service_helper_test.cpp`, `txn_lazy_commit_test.cpp`: no diagnostic in any line the pick touches (the only errors are the pre-existing macOS-only `pthread_setname_np` / `int64_t`-vs-`long` ones in untouched 2024/2025 code). clang-format 16 is clean on all 14 touched cloud files. - No BE file changes in this round (the BE side of #67820 was already byte-identical to master via #67861). - The new `auth_p0/test_binlog_tvf_auth.groovy` and the two #67820 suites parse cleanly (groovy parser check). --------- Co-authored-by: Luwei <814383175@qq.com> Co-authored-by: morrySnow <zhangwenxin@selectdb.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: None
Problem Summary:
Bounded ROW binlog queries initialize rowset readers and open segment footers before their TSO predicates reject historical data. A narrow time window can therefore pay initialization costs proportional to the retained history.
Prune the captured read source before cloning readers or creating scanners. For query
[100, 200), a rowset with inclusive commit TSO range[10, 99]can be skipped using its metadata alone.RowsetTsoPruneTime,RowsetsPrunedByTso,SegmentsPrunedByTso, andTabletsPrunedByTsoto the query profile.The filtering uses
std::erase_ifon the existing rowset vector andstd::all_offor the empty-tablet check. It adds no storage-format or protocol changes.Release note
Reduce reader initialization and segment footer IO for bounded ROW binlog queries.
Check List (For Author)
Validation:
The results below were obtained on the original master-based implementation (
cb73d23c873, based on96d0ac68e84). This PR has since been rebased ontobranch-incremental-computation(af7902c2177); the single optimization commit applies without conflicts andgit range-diffconfirms the patch is unchanged. Builds and tests have not been rerun on the new base.build.sh --be --fe -j 48.OlapScanOperatorTsoPruningTestandOlapScanOperatorBinlogPushDownTestpassed under ASAN. Coverage includes half-open boundaries, single/no bounds, unknown metadata, overlapping compaction output, delete predicates, and empty-source EOS.test_binlog_rowset_tso_pruningandtest_binlog_changes_syntaxpassed. The new output was generated by the regression runner and then checked in a second run. Before-images, deletes, empty windows, and compaction results were verified.Manual profile check: create a one-bucket UNIQUE KEY table with ROW binlog, historical values, and automatic compaction disabled; insert two rows in two separate transactions. Enable profiling and query
@incr('startTimestamp'='2099-01-01 00:00:00', 'incrementType'='MIN_DELTA'). The empty result reported:This verifies that scanner initialization is skipped. No production latency improvement is claimed; rowset metadata synchronization and version capture still occur.
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)