[fix](txn) fix abortTxn by label does not acquire table write lock (#38777) (#38842)

pick https://github.com/apache/doris/pull/38777
This commit is contained in:
meiyi
2024-08-05 16:33:20 +08:00
committed by GitHub
parent 7d4ff34d1f
commit 994c56f914

View File

@ -347,8 +347,11 @@ public class GlobalTransactionMgr implements Writable {
// 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<Table> tableList) throws UserException {