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 7ad093e
Browse filesBrowse the repository at this point in the historyBrowse files
[fix](ivm) Invalidate MV partitions by lineage, not by the sync window
Invalidation read the partition mapping through the partition_sync_limit window. A base partition the
window no longer covers can still have its rows in an MV partition: the MV was built while that
partition was inside the window, shrinking the window does not touch the MV's own partitions, and
widening it again makes partition sync keep the MV partition that holds those rows. A change to such a
partition was then read as "no MV partition reads this" -- and TRUNCATE, like the other silent changes,
emits no binlog -- so no barrier was recorded and the rows stayed in the MV for good.
Key changes:
- Add a lineage variant of the partition mapping, the generator chain without the sync-limit step, and read it when invalidating, so a changed partition is matched to the MV partitions that hold its rows regardless of the window
- Read an empty result as "nothing to rebuild" only when the MV has partitions at all: an MV without one cannot hold the changed rows, and treating it as unknown recorded a COMPLETE barrier that made a strict INCREMENTAL fail for nothing
- Report from invalidateIvmBaseline whether a barrier was recorded, and log the no-op case as such instead of claiming the baseline was invalidated
Unit Test:
- IvmBaselineRebuildTest: a base partition outside the shrunk window still marks the MV partition holding its rows (the test fails without the change), and the contention case now uses a bounded worker that is asserted to end
- MetaLockUtilsTest: tryReadLockTables releases the locks it took when a later table is busy
0 commit comments