diff --git a/fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java b/fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java index 24d92849b4978c..928fa7855079f9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/transaction/GlobalTransactionMgr.java @@ -347,8 +347,11 @@ public void abortTransaction(Long dbId, Long txnId, String reason, // for http cancel stream load api public void abortTransaction(Long dbId, String label, String reason) throws UserException { - DatabaseTransactionMgr dbTransactionMgr = getDatabaseTransactionMgr(dbId); - dbTransactionMgr.abortTransaction(label, reason); + Long txnId = getTransactionId(dbId, label); + if (txnId == null) { + throw new AnalysisException("txn with label " + label + " does not exist"); + } + abortTransaction(dbId, txnId, reason); } public void abortTransaction2PC(Long dbId, long transactionId, List tableList) throws UserException {