This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new a608c3d5dc [Fixbug]assure transaction num in image file is right 
(#9181)
a608c3d5dc is described below

commit a608c3d5dc85af49587d964e18557c96a2eec0ae
Author: dataroaring <[email protected]>
AuthorDate: Mon Apr 25 09:59:18 2022 +0800

    [Fixbug]assure transaction num in image file is right (#9181)
    
    For now, dbTransactionManager::getTransactionNum is only used by
    checkpoint to get transaction num to put into a image file. However,
    transactions written into a image file do not come from the same
    data structure as the num comes. Thus, we should pay much attention to
    assure two data structue is consistent on size. Actually, it is
    very difficult to do so.
    
    This patch just let getTransactionNum get number from the same data
    structure as write method.
    
    The change was introduced by b93e841688.
---
 .../main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
 
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
index f26a4a773a..83585ffe32 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/transaction/DatabaseTransactionMgr.java
@@ -1364,7 +1364,8 @@ public class DatabaseTransactionMgr {
     }
 
     public int getTransactionNum() {
-        return idToRunningTransactionState.size() + 
idToFinalStatusTransactionState.size();
+        return idToRunningTransactionState.size() + 
finalStatusTransactionStateDequeShort.size() +
+               finalStatusTransactionStateDequeLong.size();
     }
 
 


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

Reply via email to