yujun777 opened a new pull request, #71451:
URL: https://github.com/apache/doris/pull/71451

   ### Proposed changes
   
   Issue Number: None
   
   ### Details
   
   When an incremental refresh of an IVM materialized view containing 
`MIN`/`MAX` or `BITMAP_UNION` deletes a boundary/existing value, 
`IvmFailureReason.MIN_MAX_BOUNDARY_HIT` or `BITMAP_AGG_DELETE` is raised. 
Previously both were hardcoded in `IvmFailureReason.requiresCompleteRefresh()`, 
forcing `MTMVTask` to skip the `PARTITIONS` attempt and rebuild the entire MV 
via `COMPLETE` refresh even when the MV is a multi-partition 
`FOLLOW_BASE_TABLE` MV and only a subset of PCT base partitions changed.
   
   This PR:
   - Removes `MIN_MAX_BOUNDARY_HIT` and `BITMAP_AGG_DELETE` from 
`IvmFailureReason.requiresCompleteRefresh()` so `MTMVTask` falls back to 
`PARTITIONS` refresh first (recomputing only the affected MV partitions and 
resetting their PCT stream offsets, while leaving unchanged partitions 
untouched). Non-PCT changes and `SELF_MANAGE` MVs naturally fall through to 
`COMPLETE` refresh as before.
   - Rebuilds `MTMVRefreshContext` after an incremental fallback so the 
`PARTITIONS` attempt observes any base-table commits that arrived after the 
initial context build and triggered the fallback.
   - Guards `NOT_REFRESH` in `executePartitionBasedRefresh` after 
`MIN_MAX_BOUNDARY_HIT` / `BITMAP_AGG_DELETE` so a fallback task cannot silently 
succeed without consuming the pending stream data (escalating to `COMPLETE` 
instead).
   
   ### Release note
   
   Partitioned `FOLLOW_BASE_TABLE` IVM materialized views with `MIN`/`MAX` or 
`BITMAP_UNION` aggregates now fall back to refreshing only affected partitions 
rather than rebuilding the whole view when a PCT partition delete triggers 
recomputation.
   
   ### Testing
   
   - Updated `IvmFailureReasonTest#testRequiresCompleteRefresh`
   - Added 
`MTMVTaskTest#testMinMaxAndBitmapDeleteFallbackAllowsPartitionRefresh`
   - Verified `IvmFailureReasonTest`, `IvmIncrRefreshManagerTest`, 
`MTMVTaskTest` (109/109 passed) and Checkstyle


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to