-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
We've been observing odd transaction failures since ramping up an application that uses MongoDB 4.0 transactions. We observe the following:
1) update, with lsid=X, txnNumber=1, startTransaction=true, autocommit=false
2) commitTransaction, with lsid=X, txnNumber=1, autocommit=false
3) wait for at least 30 minutes
4) update, with lsid=X, txnNumber=2, startTransaction=true, autocommit=false
5) 2nd update, with lsid=X, txnNumber=2, autocommit=false
Despite the update in 4 succeeding, the update in 5 fails. We've added some debugging info to our mongod build and observe that when 5 fails, either _activeTxnNumber=1 and _txnState=3, or _activeTxnNumber=-1 and _txnState=0, which would indicate that mongod had seemingly lost the transaction state from 4.
The actual operation/command doesn't seem matter, as we've observed it with "aggregate" as well.