[SERVER-35793] Write concurrency test to verify server-wide transactions metrics tracking Created: 25/Jun/18  Updated: 29/Oct/23  Resolved: 24/Aug/18

Status: Closed
Project: Core Server
Component/s: Diagnostics, Replication
Affects Version/s: None
Fix Version/s: 4.0.3, 4.1.3

Type: Task Priority: Major - P3
Reporter: William Schultz (Inactive) Assignee: William Schultz (Inactive)
Resolution: Fixed Votes: 0
Labels: global-txn-metrics
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-35294 Add total number of open transactions... Closed
depends on SERVER-35295 Add total number of committed and abo... Closed
Related
is related to SERVER-36294 Sum of currentActive and currentInact... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Repl 2018-08-27, Repl 2018-09-10
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 28/Aug/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-35793 Add concurrency test for transactions metrics

(cherry picked from commit f66a67ac3e80f4968506cab34ac35668d65a13e6)
Branch: v4.0
https://github.com/mongodb/mongo/commit/db4e84885dda79d8b47b4d3688b92410937c619c

Comment by Githook User [ 24/Aug/18 ]

Author:

{'name': 'William Schultz', 'email': 'william.schultz@mongodb.com', 'username': 'will62794'}

Message: SERVER-35793 Add concurrency test for transactions metrics
Branch: master
https://github.com/mongodb/mongo/commit/f66a67ac3e80f4968506cab34ac35668d65a13e6

Generated at Thu Feb 08 04:41:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.