-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics, Replication
-
Fully Compatible
-
v4.0
-
Repl 2018-08-27, Repl 2018-09-10
It would be nice to add a basic concurrency test to verify that the various transactions metrics tracked in serverStatus uphold some basic invariants when many transactions are run concurrently. These metrics from the transactions serverStatus section include:
- currentOpen
- currentActive
- currentInactive
- totalStarted
- totalCommitted
- totalAborted
One idea would be to run several threads that each execute their own transaction. We could design the test so that we expect a certain number of write conflicts between transactions, for example. At the end of the test we could verify that the total number of expected commits and aborts is correct, as well as the total number of started transactions. We could also verify that after running many transactions and all finish, currentOpen, currentActive, and currentInactive are all zero. It would also be nice to test that
currentActive + currentInactive = currentOpen
totalCommitted + totalAborted + currentOpen = totalStarted
Some of these invariants may not always hold true due to the way we update certain counters non-atomically.
- depends on
-
SERVER-35294 Add total number of open transactions to serverStatus
- Closed
-
SERVER-35295 Add total number of committed and aborted transactions to serverStatus
- Closed
- is related to
-
SERVER-36294 Sum of currentActive and currentInactive not equal to currentOpen transactions
- Closed