seawinde commented on code in PR #66287:
URL: https://github.com/apache/doris/pull/66287#discussion_r3800233501


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/InternalCatalog.java:
##########
@@ -1012,7 +1012,8 @@ private void dropTableInternal(Database db, Table table, 
boolean isView, boolean
         } finally {
             table.writeUnlock();
         }
-        if (table instanceof OlapTable) {
+        // MTMVs persist streams as explicit relations, so dropping a stream 
must invalidate them immediately.
+        if (table instanceof OlapTable || table instanceof BaseTableStream) {

Review Comment:
   Thanks for the report. The database cascade/replay bypass predates this PR: 
`unprotectDropDb()` has directly called `unprotectDropTable()` since 2022, 
while the existing MTMV invalidation hook added for `OlapTable` runs only from 
standalone `dropTableInternal()`. Consequently, the same gap already applies to 
ordinary OLAP dependencies, not only streams.
   
   This PR does not change database-drop/replay behavior or its journal 
contract. The change at this line only extends the existing standalone-table 
hook from `OlapTable` to `BaseTableStream`, so standalone `DROP STREAM` gets 
the same behavior as standalone `DROP TABLE`.
   
   The broader database-cascade/replay and journal-ordering issue should be 
handled separately with common replay-aware invalidation and dedicated failover 
coverage. I am leaving it out of this PR to keep this fix scoped to stream 
state after its base table is dropped.



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