morningman commented on a change in pull request #5675:
URL: https://github.com/apache/incubator-doris/pull/5675#discussion_r618352964
##########
File path:
fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
##########
@@ -1076,36 +1113,53 @@ private void clearBackendTransactions(TransactionState
transactionState) {
}
public void removeExpiredTxns(long currentMillis) {
+ List<Long> expiredTxnIds = Lists.newArrayList();
+ // delete expired txns
writeLock();
try {
- while (!finalStatusTransactionStateDeque.isEmpty()) {
- TransactionState transactionState =
finalStatusTransactionStateDeque.getFirst();
- if (transactionState.isExpired(currentMillis)) {
- finalStatusTransactionStateDeque.pop();
- clearTransactionState(transactionState);
- editLog.logDeleteTransactionState(transactionState);
- LOG.info("transaction [" +
transactionState.getTransactionId() + "] is expired, remove it from transaction
manager");
- } else {
- break;
- }
+ unprotectedRemoveExpiredTxns(currentMillis, expiredTxnIds,
finalStatusTransactionStateDequeShort);
Review comment:
We tested but writing a value of size 50MB to bdbje cost about 500ms.
And the number of txn here should be much smaller than it.
So I think we don't need to wrong about it.
But I add a number to protect it
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]