[SERVER-35432] Add a method for printing out information about a slow transaction Created: 05/Jun/18  Updated: 29/Oct/23  Resolved: 25/Jul/18

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

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

Issue Links:
Backports
Depends
depends on SERVER-35434 Track aggregate OpDebug stats in Sing... Closed
depends on SERVER-35492 Rename TxnStats to SingleTransactionS... Closed
is depended on by SERVER-35867 Add abortCause to slow transaction lo... Backlog
is depended on by SERVER-35433 Log slow transactions when they finish Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Repl 2018-07-16, Repl 2018-07-30
Participants:

 Description   

We need a method that will log relevant information about a completed transaction. This will be used to log information about transactions that run too long, similar to how we currently log slow operations.Ultimately, we want to include the following stats:

  • lsid, txnNumber, readConcern, autocommit
  • readTimestamp
  • OpDebug::AdditiveMetrics for the transaction
  • terminationCause
  • abortCause
  • timeActiveMicros
  • timeInactiveMicros
  • numYields
  • locks
  • totalDuration

One approach would be to add a Session::reportTransaction method that logs this information in the appropriate format. It would have access to all the relevant transaction state already stored on the Session, including the SingleTransactionStats instance for that transaction, and its OpDebug::AdditiveMetrics object. To facilitate the logging of the stats from OpDebug::AdditiveMetrics object, we may also want to add an OpDebug::AdditiveMetrics::report method that generates a string showing the values all non-empty fields.



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

Author:

{'username': 'nxlouie', 'email': 'nathan.louie@10gen.com', 'name': 'Nathan Louie'}

Message: SERVER-35432 Add a method for printing out information about a slow transaction

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

Comment by Githook User [ 25/Jul/18 ]

Author:

{'name': 'Nathan Louie', 'email': 'nathan.louie@10gen.com', 'username': 'nxlouie'}

Message: SERVER-35432 Add a method for printing out information about a slow transaction
Branch: master
https://github.com/mongodb/mongo/commit/cdc82971d30cbac5115c532e8d296ba74aebb204

Comment by William Schultz (Inactive) [ 06/Jul/18 ]

The ultimate goal should be for the logging format to match that used in OpDebug::report, with the appropriate fields swapped to include transaction specific ones.

Also, we will just hard-code the numYields field, instead of tracking it explicitly. It should always be 0 for multi-document transactions.

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