-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics, Replication
-
Fully Compatible
-
v4.0
-
Repl 2018-07-16, Repl 2018-07-30
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.
- depends on
-
SERVER-35434 Track aggregate OpDebug stats in SingleTransactionStats
- Closed
-
SERVER-35492 Rename TxnStats to SingleTransactionStats
- Closed
- is depended on by
-
SERVER-35867 Add abortCause to slow transaction logging
- Backlog
-
SERVER-35433 Log slow transactions when they finish
- Closed