You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5cdbd2c
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](fe) Rebuild IVM baseline after excluded trigger changes (apache#18)
Changing `excluded_trigger_tables` can change which base table updates are considered when deciding whether an MTMV is fresh. On the IVM branch, adding a changed base table to `excluded_trigger_tables` could leave the old refresh snapshot baseline in place and allow the refresh path to skip the changed table or take the IVM no-op fast path, leaving stale MV data.
Root cause: In the MTMV refresh path, the refresh snapshot baseline was not fully invalidated/rebuilt after `excluded_trigger_tables` changed, and fallback-capable IVM refresh could still use the IVM fast path before a complete baseline was rebuilt.
Change Summary:
| File | Change Description |
|------|--------------------|
| `MTMVTask.java` | Treat incomplete refresh snapshots as requiring a full partition refresh and avoid silently using stale incremental baselines. |
| `MTMVTaskTest.java` | Cover incomplete refresh snapshot partition selection behavior. |
| `AlterMTMVTest.java` | Cover excluded-trigger ALTER validation and baseline invalidation scope. |
| `test_ivm_excluded_trigger_table.groovy` | Add IVM excluded-trigger coverage for incremental refresh suppression and fallback after ALTER. |
| `test_ivm_plan_signature_fallback.groovy` | Verify IVM plan signature changes trigger fallback-capable refresh to rebuild through COMPLETE mode. |
| `test_excluded_trigger_table_mtmv.groovy` | Update manual refresh modes away from illegal `AUTO` and add ordinary partitioned MTMV excluded-trigger coverage. |
Design Rationale:
Fallback-capable IVM refresh now rebuilds a complete baseline when the refresh snapshot is incomplete. Explicit `INCREMENTAL` refresh without fallback still fails for incomplete baselines instead of silently falling back, preserving the requested refresh semantics.
```mermaid
graph TD
A[ALTER excluded_trigger_tables] --> B[Invalidate refresh snapshot baseline]
B --> C[Next REFRESH]
C --> D{Snapshot complete?}
D -- No + fallback capable --> E[Run COMPLETE refresh]
D -- No + explicit INCREMENTAL --> F[Reject incomplete baseline]
D -- Yes --> G[Run incremental/partition refresh]
```
0 commit comments