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 ff3f291
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](ivm) Rebuild the whole MV when the changed partitions may be outside the sync window
The mapping that invalidation reads is filtered by partition_sync_limit, so an empty selection does not
by itself say that no MV partition holds the changed rows: a base partition the window has dropped can
still have its rows in an MV partition, because shrinking the window does not touch the MV's own
partitions and widening it again makes partition sync keep them. Reading the unfiltered lineage instead
is precise, but it turns every partition of the base table's history into MV partitions while the read
locks the selection takes are held, and the DDL that triggered it holds the changed table's write lock.
Key changes:
- Rebuild the whole MV when the selection comes out empty while a partition_sync_limit is in effect; without one the windowed and the full mapping are the same set, so an empty selection still means that no MV partition holds those rows
- Read that from the generator's own parsing, exposed as MTMVPartitionUtil.isPartitionSyncLimitActive, so the property is interpreted in one place
- The regression asserts the terminal task's status rather than only the MV's rows: partition sync drops the MV partition first, so a failed refresh could leave a row set that matches
Unit Test:
- IvmBaselineRebuildTest: a changed partition outside the shrunk window rebuilds the whole MV (the test fails without the change)
- Regression: mtmv_p0/ivm/test_ivm_baseline_marker_scope pins SUCCESS on the narrowed refresh, and the suite runs no differently otherwise
0 commit comments