luwei16 commented on code in PR #37669:
URL: https://github.com/apache/doris/pull/37669#discussion_r1686097861


##########
fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java:
##########
@@ -442,6 +444,54 @@ public boolean existCommittedTxns(Long dbId, Long tableId, 
Long partitionId) {
         return false;
     }
 
+    public static boolean checkFailedTxnsByStartTime(TransactionState txn) {
+        TxnCoordinator coordinator = txn.getCoordinator();
+        if (coordinator.sourceType == TransactionState.TxnSourceType.FE) {
+            List<Frontend> frontends = Env.getCurrentEnv().getFrontends(null);
+            for (Frontend fe : frontends) {
+                if (fe.getHost().equals(coordinator.ip) && 
fe.getLastStartupTime() > coordinator.startTime) {
+                    return true;
+                }
+            }
+        } else if (coordinator.sourceType == 
TransactionState.TxnSourceType.BE) {
+            Backend be = Env.getCurrentSystemInfo().getBackend(coordinator.id);

Review Comment:
   Consider the case where be is offline



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to