Conversation
### What problem does this PR solve? Issue Number: close #DORIS-24834 Related PR: None Problem Summary: The regression test could run EXPLAIN before the synchronous materialized view index row count was reported to FE, causing unstable MV rewrite selection. Poll the MV index statistics until the Nereids row count reaches the expected value before checking the rewrite plan. ### Release note None ### Check List (For Author) - Test: Regression test: rollup_p0/test_create_mv_and_mtmv - Behavior changed: No - Does this need documentation: No Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
buildall |
Contributor
Author
|
/review |
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
There was a problem hiding this comment.
Approval opinion: no blocking findings.
The added wait addresses the reported race by polling the same strict synchronous-MV row count that Nereids consumes before asserting the rewrite plan. Round 1 converged with both full-review passes and the separate readiness/lifecycle risk pass returning NO_NEW_VALUABLE_FINDINGS; the main review independently resolved every risk item. No additional user review focus was supplied.
Critical checkpoint conclusions:
- Goal and proof: the fifth
SHOW INDEX STATSfield isreport_row_count_for_nereids, backed byOlapTable.getRowCountForIndex(indexId, true), exactly as used byStatsCalculator. The subsequent EXPLAIN remains the behavioral oracle. The author reports./run-regression-test.sh --run -d rollup_p0 -s test_create_mv_and_mtmvpassing; this automated review was static-only and did not independently run it. - Scope and clarity: the change is confined to the affected regression suite and adds only the readiness gate and diagnostics needed before the existing EXPLAIN.
- Concurrency: shared-nothing
TabletStatMgrand the cloud stats path update the row count asynchronously. Strict mode stays unknown until all visible index tablets report, including the empty third partition, and exact[2]rejects transient unknown or zero observations. SHOW and the following EXPLAIN execute on the same FE. - Lifecycle and failure handling:
createMVfirst waits for the rollup job to finish; the new loop then waits for stats publication. It is bounded, SQL/conversion/interruption failures propagate, and timeout preserves logged observations plus the final actual value. - Configuration and parallel paths: no configuration is added. The normal 60-second stats cadence and cloud P0 10-second cadence both fit comfortably inside the bound; shared-nothing and cloud paths provide the same strict planner-facing signal.
- Compatibility and protocol: no production API, persisted format, FE/BE field, rolling-upgrade behavior, or function symbol changes.
- Conditions and tests: the immutable two-row fixture yields exactly two MV groups, so
[2]is deterministic. The readiness assertion is internal synchronization rather than a result-set oracle; the existing ordered MTMV result checks and EXPLAIN check remain unchanged. - Observability: every probe logs the complete SHOW result and derived row counts; no production metrics or logs are needed for this test-only change.
- Transactions, writes, and persistence: only the existing test fixture performs writes; production transactionality, edit-log behavior, visibility rules, and crash recovery are untouched.
- Performance and other risks: probes are one-row local metadata reads and stop as soon as readiness is observed. No hot production path, memory-accounting issue, deadlock, or distinct correctness problem was found.
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?
The regression test could run EXPLAIN before the synchronous materialized view index row count was reported to FE, causing unstable MV rewrite selection. This change polls
SHOW INDEX STATS <table> <mv>and waits forreport_row_count_for_nereidsto reach the expected value before checking the rewrite plan.Test Plan
./run-regression-test.sh --run -d rollup_p0 -s test_create_mv_and_mtmvRelease note
None