[SERVER-41375] Add successfulDurationMicros for each commitType in mongos transactions serverStatus output Created: 29/May/19  Updated: 29/Oct/23  Resolved: 13/Jun/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.2.0-rc3, 4.3.1

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: James Heppenstall (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-40984 Track and log relevant router-wide tr... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.2
Sprint: Sharding 2019-06-17
Participants:

 Description   

As per the scope document, track the amount of time spent waiting on successful commits for each type of commit on mongos and add them to the "transactions" field in its serverStatus output.

This was spun off from SERVER-40984.

 Proposed Implementation

  • Add atomic int64_t field "successfulDurationMicros" to RouterTransactionMetrics::CommitStats
  • When a transaction ends with TerminationCause::committed (i.e. successfully commits), add the transaction's commit duration to the atomic field
  • Update RouterTransactionMetrics::updateStats() and add "successfulDurationMicros" long type to the CommitTypeStats IDL type (in router_transaction_stats.idl) to include successfulDurationMicros in serverStatus output
  • Add unit / jstests
    • Update existing jstests/noPassthrough/router_transaction_metrics.js and add new cases to transaction_router_test.cpp
    • Some basic unit test cases: verify the field is incremented on successful commits, not on abort, not on unknown commit results, and that the field is cumulative across transactions


 Comments   
Comment by Githook User [ 24/Jun/19 ]

Author:

{'name': 'Jamie Heppenstall', 'username': 'JamesHeppenstall', 'email': 'jamie.heppenstall@mongodb.com'}

Message: SERVER-41375 Add successfulDurationMicros to commitTypes in mongos transactions serverStatus output

(cherry picked from commit 2a0c2ce0f12dd1bbe485da1c2fdcb9d6a7a30bee)
Branch: v4.2
https://github.com/mongodb/mongo/commit/248cff0efec0143d787b5bd7207bb845dc8e3baa

Comment by Githook User [ 13/Jun/19 ]

Author:

{'name': 'Jamie Heppenstall', 'email': 'jamie.heppenstall@mongodb.com', 'username': 'JamesHeppenstall'}

Message: SERVER-41375 Add successfulDurationMicros to commitTypes in mongos transactions serverStatus output
Branch: master
https://github.com/mongodb/mongo/commit/2a0c2ce0f12dd1bbe485da1c2fdcb9d6a7a30bee

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