hello-stephen commented on code in PR #71451:
URL: https://github.com/apache/doris/pull/71451#discussion_r4811017831


##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java:
##########
@@ -436,14 +437,38 @@ public void run() throws JobException {
                         fallingBack = 
givingUpTheIncrementalAttemptIsAFallback();
                         if (ivmResult == 
AttemptResultType.FALLBACK_TO_COMPLETE) {
                             disablePartitionRefresh = true;
+                        } else if (isPartialPartitionFallback()) {
+                            // Refresh cloud partition versions from Meta 
Service and rebuild
+                            // refreshContext so the PARTITIONS fallback sees 
every commit the
+                            // failed delta observed (including commits not 
yet in FE cache).
+                            // If refreshing metadata fails, escalate to 
COMPLETE instead of
+                            // failing a fallback-enabled refresh.
+                            try {
+                                refreshCloudBasePartitionVersions(tableIfs);

Review Comment:
   [P2] Refresh non-PCT table versions before accepting a subset
   
   This fetch updates `CloudPartition` versions. 
`MTMVPartitionUtil.getTableVersions` still uses the separate `OlapTable` 
table-version cache for non-PCT inputs, and Meta Service can expose a dimension 
commit before the FE updates that cache. Consider a three-partition MIN view 
over a partitioned fact table joined to a non-PCT dimension. A delete of the 
retained minimum in `p1` sends the delta to fallback while the delta's stream 
can already see a committed dimension update affecting `p2`. The refreshed 
context can accept `p1` alone because `p2` is compared against the old table 
version. The overwrite then uses the dimension's old `SNAPSHOT` offset and 
reports success with `p2` stale and the dimension update pending. Use 
authoritative non-PCT versions or the failed delta's read state to establish 
coverage before accepting the subset.



##########
fe/fe-core/src/main/java/org/apache/doris/job/extensions/mtmv/MTMVTask.java:
##########
@@ -436,14 +437,38 @@ public void run() throws JobException {
                         fallingBack = 
givingUpTheIncrementalAttemptIsAFallback();
                         if (ivmResult == 
AttemptResultType.FALLBACK_TO_COMPLETE) {
                             disablePartitionRefresh = true;
+                        } else if (isPartialPartitionFallback()) {

Review Comment:
   [P3] Skip the cloud version fetch when PARTITIONS is already ruled out
   
   A `SELF_MANAGE` MIN view over a large partitioned fact table always needs 
`COMPLETE` after this guard fails. This branch still sends every source 
partition to Meta Service and can wait through the version RPC retries before 
reaching the same `COMPLETE` attempt. Check the view's partition mode and count 
before fetching versions.



-- 
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