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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/InsertIntoTableCommand.java:
##########
@@ -285,6 +292,36 @@ public AbstractInsertExecutor initPlan(ConnectContext ctx, 
StmtExecutor stmtExec
                 return insertExecutor;
             }
 
+            List<ScanNode> tableStreamScanNodes =
+                    buildResult.planner.getScanNodes().stream()
+                            .filter(s -> s.getTableIf() instanceof 
OlapTableStreamWrapper).collect(Collectors.toList());
+
+            // stream id -> <partition id, offset>

Review Comment:
   `OlapTableStream.checkStreamOffset()` now requires `nextOffset` for every 
non-historical partition, but this new path always constructs 
`TableStreamUpdateInfo` with `java.util.Collections.emptyMap()`. That means any 
insert reading a normal stream partition will fail in 
`DatabaseTransactionMgr.commitTransaction()` with `nextOffset missing ...`, so 
the newly added consumption flow cannot successfully commit. Where is the next 
partition offset supposed to be populated for this path?



##########
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java:
##########
@@ -815,6 +819,10 @@ public void commitTransaction(List<Table> tableList, long 
transactionId, List<Ta
             checkCommitStatus(tableList, transactionState, tabletCommitInfos, 
txnCommitAttachment, errorReplicaIds,
                     tableToPartition, totalInvolvedBackends);
         }
+        // check stream offset update

Review Comment:
   `checkAndUpdateStreamOffset(transactionState)` mutates the stream metadata 
before the transaction state is durably upserted. If FE crashes after this call 
but before `persistTransactionState()`/`enqueueTransactionState()` is flushed, 
replay will restore the transaction from the old journal state but the stream 
offset advancement is already lost from memory, so the same source data can be 
consumed again after failover. This metadata change needs to be made 
replay-equivalent with the transaction journal, or deferred until the durable 
transaction transition is guaranteed.



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