-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics
-
Fully Compatible
-
ALL
-
v4.0
-
Repl 2018-08-13
Small inaccuracies due to skew might be expected because the counter updates aren't atomic, but this looks to me to be much larger than that, as if the transaction is spending significant time between between corresponding updates to the counters.
This was a simple test with 10 threads doing transactional updates to single independent documents:
function repro() { nthreads = 10 db.createCollection("c", {writeConcern: {w: "majority"}}) threads = [] for (var t=0; t<nthreads; t++) { thread = new ScopedThread((t) => { var ses = db.getMongo().startSession() ses.getDatabase("test").c.insert({_id: t, i: 0}) for (;;) { try { ses.startTransaction() ses.getDatabase("test").c.update({_id: t}, {$inc: {i: 1}}) //if (t==0) sleep(1000) ses.commitTransaction() } catch (e) { print(e) } } }, t) threads.push(thread) thread.start() } for (var t = 0; t < nthreads; t++) threads[t].join() }
- related to
-
SERVER-36295 Transaction metrics not updated on TransientTransactionError
- Closed
-
SERVER-35793 Write concurrency test to verify server-wide transactions metrics tracking
- Closed