Repository navigation
[fix](cloud) Preserve tablet stats when row-count version lookup fails - #70895
Conversation
### Background Cloud FE fetches statistics for batches of tablets. For changelog tablets it also requests the published partition version associated with the row count. The response already supports omitting that version, and FE treats absent coverage as unknown. ### What problem does this PR solve? Issue Number: None Related PR: apache#69896 (introduced the optional row-count version read) PR Type: Bugfix Problem Summary: A read or parse error on an optional partition version aborts the tablet statistics batch. For example, a request with a malformed changelog tablet version followed by an ordinary tablet with 100 rows returns a non-OK status, and FE discards the response. With this change the batch returns both statistics entries, omits the affected tablet's version, and reports the ordinary tablet's 100 rows. ### Details - **Frequency:** Always when the optional lookup hits a read or parse error after the tablet stats were read successfully. - **Root cause:** GetTabletStats treated an optional coverage lookup like a tablet stats read error and returned an RPC-level failure before processing the rest of the batch. - **Why existing tests missed it:** The legacy and versioned GetTabletStats tests cover successful statistics reads, including valid coverage. The changelog SQL suites test the resulting row estimates without injecting a malformed optional version document into a mixed batch. - **Fix:** Keep the tablet stats, log the coverage error, and omit the optional field for the affected tablet. Missing partition versions still map to version 1 and errors when reading the stats themselves still fail the RPC. - **Other paths and branches:** The change covers both legacy and versioned Cloud metadata reads. The optional lookup is absent from the checked upstream 3.1, 4.0, 4.1, and 4.2 release branches. - **Behavior change:** An optional version-read error no longer discards independently readable tablet statistics in the same batch. ### Testing - Both new ASAN tests fail against the baseline at the batch status assertion. The legacy path returns 1006 (malformed partition version) and the versioned path returns 1003 (invalid data). - All five GetTabletStats tests passed in the ASAN Cloud test runner, including the two new mixed-batch cases, normal legacy and versioned reads, and the HTTP stats path. - Clang-format v16 and clang-tidy passed. No live-cluster regression was run. ### Release note Cloud tablet statistics remain available when an optional changelog row-count version lookup fails. ### Check List (For Author) - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready
|
run buildall |
|
/review |
Local pipeline review — ✅ PASSschema: doris-repo-review/v1
status: PASS
pr: apache/doris#70895
commit: ff78fb13ce61610bd6279925f96350c5d3fb2908
base: a0662fea1d048695b751edc9b69933a12cd68eaf
reviewed_at: 2026-11-23T20:32+08:00
reviewer: yujun777
model: gpt-6-astra
effort: xhigh
findings: {blocker: 0, major: 0, minor: 0, nit: 0}
rounds: 1
converged: trueNotes for maintainers
Reviewed locally with the |
There was a problem hiding this comment.
Static review of PR #70895 at head ff78fb1 against base a0662fe converged in round 1. The change is focused: after tablet statistics have been read successfully, failures reading the optional row-count partition version are logged and the coverage field is omitted, while failures reading the required tablet statistics still return the existing non-OK response. I traced both legacy and versioned metadata paths, CloneChainReader fallback behavior, RPC preprocessing/status finalization, per-tablet transaction cleanup, and the FE CloudTabletStatMgr/Replica/MaterializedIndex consumers. The omitted-version handling preserves newer reports and causes refresh/exclusion once a published changelog version is required. No correctness, concurrency, lifecycle, compatibility, persistence, observability, performance, or security defect was substantiated. The added tests cover malformed version values in mixed batches for both legacy and versioned reads, continued processing, omitted coverage, and preservation of ordinary tablet rows. No additional user focus was supplied. Review validation was static inspection only; builds, tests, and runtime checks were not rerun. No existing blocking inline findings apply.
Review converged after 1 round(s).
Background
Cloud FE fetches statistics for batches of tablets. For changelog tablets it also requests the published partition version associated with the row count. The response already supports omitting that version, and FE treats absent coverage as unknown.
What problem does this PR solve?
Issue Number: None
Related PR: #69896 (introduced the optional row-count version read)
PR Type: Bugfix
Problem Summary:
A read or parse error on an optional partition version aborts the tablet statistics batch. For example, a request with a malformed changelog tablet version followed by an ordinary tablet with 100 rows returns a non-OK status, and FE discards the response. With this change the batch returns both statistics entries, omits the affected tablet's version, and reports the ordinary tablet's 100 rows.
Details
Testing
Release note
Cloud tablet statistics remain available when an optional changelog row-count version lookup fails.
Check List (For Author)