-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Replication, Storage
-
Fully Compatible
-
ALL
-
Storage NYC 2019-03-25, Storage NYC 2019-04-08
When we recover a prepared transaction, we re-apply the oplog entry and replay the operations in the transaction to get back to the prepare state. This line prevents us from adding a NumRecordsChange on the new recovery unit.
During rollback, say we commit a prepared transaction on the rollback node. This entry will get rolled back, the transaction will get invalidated (which releases our txnResources, including the recovery unit), and we will replay oplog entries from the stable timestamp. This involves putting the corresponding prepared transaction back into prepare.
Since the new recovery unit does not register the operations of the prepared transaction, when we decide to either commit/abort it, there is nothing to add or subtract to numRecords.
Previously, we have accounted for counts during rollback in _findRecordStoreCounts, where we calculate the diffs for each UUID. For prepared transactions, however, we are not sure if we will eventually commit or eventually abort the transaction. So, it might not make sense to preemptively change the counts.
Ideally, we would figure out a way for the new recovery unit to make an exception for prepared transactions that were recovered during rollback and make sure the changes get recorded when reapplying operations.
- depends on
-
SERVER-35872 Reconstruct prepared transactions on replication rollback
- Closed
- is related to
-
SERVER-35483 rollback makes config.transactions fastcount inaccurate
- Closed
-
SERVER-40269 commitTransaction should assert that the prepare oplog entry is majority committed
- Closed
- related to
-
SERVER-40482 incorrect fastcount for a majority committed prepared transaction that is in prepare after a rollback and then committed
- Closed
-
SERVER-40973 Incorrect fast count after reconstructing a prepared transaction in initial sync and then aborting it
- Closed