Skip to content

Commit 0391e1c

Browse files
authored
[Fix](cloud-mow) Fix Fe memory leak due to txnLastSignatureMap (#59385)
### What problem does this PR solve? introduced in #50417 entry in `txnLastSignatureMap` is not cleared when the commit is launched by BE
1 parent 04157ad commit 0391e1c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

fe/fe-core/src/main/java/org/apache/doris/cloud/transaction/CloudGlobalTransactionMgr.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ public void commitTransactionWithoutLock(long dbId, List<Table> tableList, long
428428
}
429429
commitTransactionWithoutLock(dbId, tableList, transactionId, tabletCommitInfos, txnCommitAttachment, false,
430430
mowTableList, backendToPartitionInfos);
431+
// clear signature after commit succeeds
432+
clearTxnLastSignature(dbId, transactionId);
431433
} catch (Exception e) {
432434
if (!mowTableList.isEmpty()) {
433435
LOG.warn("commit txn {} failed, release delete bitmap lock, catch exception {}", transactionId,
@@ -1498,6 +1500,8 @@ public boolean commitAndPublishTransaction(DatabaseIf db, long transactionId,
14981500
}
14991501
commitTransactionWithSubTxns(db.getId(), tableList, transactionId, subTransactionStates, mowTableList,
15001502
backendToPartitionInfos);
1503+
// clear signature after commit succeeds
1504+
clearTxnLastSignature(db.getId(), transactionId);
15011505
} catch (Exception e) {
15021506
if (!mowTableList.isEmpty()) {
15031507
LOG.warn("commit txn {} failed, release delete bitmap lock, catch exception {}", transactionId,
@@ -1679,6 +1683,8 @@ public boolean commitAndPublishTransaction(DatabaseIf db, List<Table> tableList,
16791683
beforeCommitTransaction(tableList, transactionId, timeoutMillis);
16801684
try {
16811685
commitTransactionWithoutLock(db.getId(), tableList, transactionId, tabletCommitInfos, txnCommitAttachment);
1686+
// Only clear signature after commit succeeds, as BE may retry on failure
1687+
clearTxnLastSignature(db.getId(), transactionId);
16821688
} finally {
16831689
stopWatch.stop();
16841690
long costTimeMs = stopWatch.getTime();
@@ -1746,6 +1752,7 @@ public void abortTransaction(Long dbId, Long transactionId, String reason,
17461752
abortTxnResponse = abortTransactionImpl(dbId, transactionId, reason, null);
17471753
} finally {
17481754
handleAfterAbort(abortTxnResponse, txnCommitAttachment, transactionId);
1755+
clearTxnLastSignature(dbId, transactionId);
17491756
}
17501757
}
17511758

0 commit comments

Comments
 (0)