mrhhsg opened a new pull request, #70946:
URL: https://github.com/apache/doris/pull/70946
### What problem does this PR solve?
Issue Number: None
Related PR: #70836
Cherry-picked from #70836 (source commit
`f83708623ac141d6ba21d0f9372bbe63ec04723f`) to `branch-4.1`.
OLAP scanners currently construct a complete FileCache profile reporter for
each batch and clear the reader's FileCache statistics afterward. This
repeatedly looks up/registers counters on the shared profile. Keep byte
accounting incremental while deferring detailed FileCache reporting until
scanner termination.
### Changes
- Pre-register `BytesScannedFromCache`, `BytesScannedFromRemote`, and
`BytesWriteIntoCache` under `FileCache`, preserving their names, byte units,
and level-1 hierarchy.
- Retain cumulative reader FileCache statistics. Track per-scanner published
byte totals and update profile counters, I/O accounting, and metrics using byte
deltas.
- Preserve compressed-byte local accounting for page-cache-only batches,
including batches following earlier FileCache reads.
- At terminal collection, report detailed statistics using a copy and
subtract already-published bytes to avoid double counting. Retain the existing
one-time collection guard.
### Backport notes and behavior
- Preserve the existing `branch-4.1` scanner context; do not import
unrelated master read-ahead support.
- Initialize `nullable_tuples` in the unit-test plan node to satisfy the
`branch-4.1` row-descriptor contract.
- The three byte counters remain realtime; detailed FileCache
counters/timers are populated at scanner termination. This change does not
refresh an already-saved fragment profile snapshot or add FE profile transport
behavior.
- No SQL semantics, configuration defaults, or wire formats are changed. No
measured performance gain is claimed.
### Validation
- Release FE/BE build and packaging passed, including FE Maven/checkstyle:
`env BUILD_TYPE=Release FE_MAVEN_THREADS=8 DISABLE_BE_JAVA_EXTENSIONS=ON
timeout 3600 ./build.sh --be --fe -j 48`.
- Focused ASAN unit tests: **12 passed**:
`./run-be-ut.sh --run -j 48
--filter='OlapFileCacheProfileTest.*:OlapFileCacheFinalProfileTest.*:DorisMetricsTest.*:OlapScannerTest.*'`.
- Accounting/lifetime/scanner coverage: **14 ASAN tests × 20 shuffled
repetitions = 280 passes**, starting with random seed 42. The singleton-metrics
tests were run in the standard single-pass suite, not in the repeated run.
- `test_unified_limit_pushdown`: **1 suite passed; 0 failed, 0 fatal, 0
skipped**, against an isolated local non-cloud FE/BE cluster. The suite and
expected output were extracted unchanged from the fixed source commit because
this suite is not present on the target branch; no expected output was
regenerated.
- clang-format 16 checked all six changed C++ files; `git diff --check`
passed.
Not validated: real cloud FileCache end-to-end behavior, FE final-profile
transport, mixed-version deployment, the full CI matrix, or comparative
performance benchmarks.
### Release note
None
### Check List (For Author)
- Test:
- [x] Regression test
- [x] Unit Test
- Behavior changed:
- [x] Yes: detailed FileCache profile reporting is deferred until scanner
termination; byte counters remain realtime.
- Does this need documentation?
- [x] No.
--
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]