[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.
This commit is contained in:
dataroaring
2022-04-25 09:59:18 +08:00
committed by GitHub
parent 2d83167e50
commit a608c3d5dc

View File

@ -1364,7 +1364,8 @@ public class DatabaseTransactionMgr {
}
public int getTransactionNum() {
return idToRunningTransactionState.size() + idToFinalStatusTransactionState.size();
return idToRunningTransactionState.size() + finalStatusTransactionStateDequeShort.size() +
finalStatusTransactionStateDequeLong.size();
}