[fix](regression) Fix flaky materialized view load-open test - #67138
[fix](regression) Fix flaky materialized view load-open test#671380AyanamiRei wants to merge 1 commit into
Conversation
### What problem does this PR solve? Issue Number: N/A Related PR: N/A Problem Summary: The regression case used createMV, which waits for the latest materialized view job in the shared database. Under parallel suite execution, it could observe a concurrent job as FINISHED and run ADD COLUMN while its own table was still in ROLLUP state. Use create_sync_mv for all four materialized views so each wait is scoped to its base table. ### Release note None ### Check List (For Author) - Test: No need to test (test-only synchronization change; not run per request) - Behavior changed: No - Does this need documentation: No
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
There was a problem hiding this comment.
Review opinion: approve. I found no blocking issue and no inline finding to raise.
Critical checkpoint conclusions:
- Goal and evidence: The change fixes the concrete parallel-suite race. The deprecated
createMVpolls the database-wide latest MV job, while each replacement waits for the latest MV job belonging to its own base table. The four changed tables are uniquely owned by this suite, so unrelated jobs in the sharedrollup_p0database cannot satisfy the new waits. - Scope and clarity: The patch is focused: it replaces all four unsafe helper calls and repairs the final newline. The MV names, base tables, projections, aliases, grouping, DDL/DML, stream load, and expected results are otherwise unchanged.
- Concurrency: This checkpoint is applicable because normal suites can run concurrently in the same directory-derived database. The sibling suite reuses the MV names but owns distinct
*_mmtables; exactTableNamefiltering excludes those jobs. The changed suite itself executes these calls sequentially, and no same-table competing MV producer exists. - Lifecycle and errors:
create_sync_mvwaits for the rollup job, assertsFINISHED, retains the post-job table-state delay, and issuesSYNCbefore later inserts or schema changes. SQL failure, cancellation, and timeout remain fail-closed. No new resource ownership, static initialization, lock ordering, or release lifecycle is introduced. - Configuration: No configuration item or dynamic-setting behavior changes. Existing dynamic-partition and light-schema-change properties remain test inputs only.
- Compatibility: No production symbol, RPC/thrift field, serialization, storage format, FE/BE contract, cloud/shared-nothing behavior, or rolling-upgrade path changes.
- Parallel paths and conditions: All four unsafe calls are migrated, covering dynamic partition on/off and light schema change true/false. No new conditional branch is introduced, and the sibling path already waits by its distinct base tables.
- Test coverage and results: The existing end-to-end suite exercises all four variants, later inserts, both schema changes, stream load, and ordered result checks. SQL semantics and the
.outdata are unchanged, so no result-file update is expected. I did not run builds or tests because this review runner explicitly prohibits them; the PR also records that this synchronization-only change was not run. - Observability: The established helper logs the table-filtered SHOW query and status transitions and asserts the terminal state, which is sufficient for this regression synchronization path. No production metric or log change is warranted.
- Transactions, persistence, and data writes: No production transaction, EditLog/replay, failover, or write implementation changes. The existing test DML now begins only after the intended rollup job and metadata synchronization complete.
- FE/BE variables: No transmitted variable or scattered send path is added or changed.
- Performance: The scoped no-op DROP, bounded polling, and SYNC add modest test-only setup work in exchange for deterministic ordering; no production hot path, memory accounting, CPU, or allocation behavior changes.
- Other core invariants: No production data visibility, visible-version, delete-bitmap, nullable-column, memory-safety, or security boundary is modified. The stronger wait prevents
ADD COLUMNfrom racing a table still in ROLLUP state.
User focus: No additional user-provided focus was specified; the complete PR review found no additional issue.
Review completion: One convergence round completed. Two independent full-review agents and one separate risk-focused agent all returned NO_NEW_VALUABLE_FINDINGS after missed-issue rechecks. The main review independently cleared job correlation and helper side-effect risks, and the final changed-file/unresolved-candidate sweep found nothing outstanding.
What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
test_materialized_view_load_openusedcreateMV, which waits for the latest materialized view job in the shared database. Under parallel suite execution, it can observe a concurrent job asFINISHEDand executeADD COLUMNwhile its own table is still inROLLUPstate.Replace all four calls with
create_sync_mvso each materialized view creation waits for the job belonging to its base table.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)