github-actions[bot] commented on code in PR #66287:
URL: https://github.com/apache/doris/pull/66287#discussion_r3765009108


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelation.java:
##########
@@ -114,4 +123,28 @@ private void compatible(CatalogMgr catalogMgr, 
Set<BaseTableInfo> infos) throws
             baseTableInfo.compatible(catalogMgr);
         }
     }
+
+    private void addStreamBaseTables(Set<BaseTableInfo> infos) throws 
Exception {
+        if (CollectionUtils.isEmpty(infos)) {
+            return;
+        }
+        // Older images may contain only the stream relation; add its stable 
base so freshness and invalidation survive
+        // an upgrade without inventing a historical snapshot for the newly 
discovered dependency.
+        for (BaseTableInfo info : new HashSet<>(infos)) {
+            TableIf table;
+            try {
+                table = MTMVUtil.getTable(info);
+            } catch (AnalysisException e) {

Review Comment:
   **[P1] Do not complete migration while the stream is missing**
   
   For an old image where `M` records stream `S` but not its base `T`, 
recoverably drop `S` before loading the image. `MTMVUtil.getTable(info)` throws 
here, but this `continue` lets compatibility succeed and re-register only the 
old `S` relation. After same-name `RECOVER TABLE S`, compatibility is not 
rerun; freshness treats the recovered stream as synchronous, while `M` still 
has neither a snapshot nor an invalidation edge for `T`, so writes to `T` can 
leave stale rows rewrite-eligible. This is a residual branch in the newly added 
migration, distinct from the prior available-stream case. Please fail 
compatibility or persist a pending migration when the relation cannot be 
resolved, or rerun expansion before a recovered stream can make the MTMV a 
candidate, and add an old-image drop/recover-stream test.



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