user-GitHub-user opened a new issue, #27884:
URL: https://github.com/apache/doris/issues/27884

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   1.2.6
   
   ### What's Wrong?
   
   doris出现内存异常升高,查看堆栈发现可能是TransactionState 堆积:
   ![Uploading image.png…]()
   
    从 [https://github.com/apache/doris/pull/4013/files] 起,createTxnCleaner 
使用LatestTxnId来同步FE 
的事务删除,请问是否会出现下面这种情况:LatestTxnId已经被其他操作删除,而在两个Deque一直找不到LatestTxnId,直到Deque队列被全部删除,如LatestTxnId被cleanLabel,我注意到cleanLabel操作的EditLog记录没有被transactionLock锁住,这是否会导致binglog同步不一致呢?
   `    public void 
replayBatchRemoveTransaction(BatchRemoveTransactionsOperationV2 operation) {
           writeLock();
           try {
               if (operation.getLatestTxnIdForShort() != -1) {
                   while (!finalStatusTransactionStateDequeShort.isEmpty()) {
                       TransactionState transactionState = 
finalStatusTransactionStateDequeShort.pop();
                       
clearTransactionState(transactionState.getTransactionId());
                       if (operation.getLatestTxnIdForShort() == 
transactionState.getTransactionId()) {
                           break;
                       }
                   }
               }
   
               if (operation.getLatestTxnIdForLong() != -1) {
                   while (!finalStatusTransactionStateDequeLong.isEmpty()) {
                       TransactionState transactionState = 
finalStatusTransactionStateDequeLong.pop();
                       
clearTransactionState(transactionState.getTransactionId());
                       if (operation.getLatestTxnIdForLong() == 
transactionState.getTransactionId()) {
                           break;
                       }
                   }
               }
           } finally {
               writeUnlock();
           }
       }`
   
   ` try {
               DatabaseTransactionMgr dbTxnMgr = 
Env.getCurrentGlobalTransactionMgr().getDatabaseTransactionMgr(dbId);
               dbTxnMgr.cleanLabel(label);
           } catch (AnalysisException e) {
               // just ignore, because we don't want to throw any exception 
here.
           }
   
           // 3. Log
           if (!isReplay) {
               CleanLabelOperationLog log = new CleanLabelOperationLog(dbId, 
label);
               Env.getCurrentEnv().getEditLog().logCleanLabel(log);
           }`
   
   
   ### What You Expected?
   
   TransactionState 正常
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to