diff options
author | Nathan Louie <nathan.louie@10gen.com> | 2018-07-09 14:41:37 -0400 |
---|---|---|
committer | Nathan Louie <nathan.louie@10gen.com> | 2018-07-25 11:25:39 -0400 |
commit | cdc82971d30cbac5115c532e8d296ba74aebb204 (patch) | |
tree | 6bc886649e6eaa502f92b6b0dfabfcefa9ecd43a /src/mongo/db/session.h | |
parent | ce430952c35a9409ee80d03f70b6b618aa1802cd (diff) | |
download | mongo-cdc82971d30cbac5115c532e8d296ba74aebb204.tar.gz |
SERVER-35432 Add a method for printing out information about a slow transaction
Diffstat (limited to 'src/mongo/db/session.h')
-rw-r--r-- | src/mongo/db/session.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/session.h b/src/mongo/db/session.h index 51c4ad71370..6f5cf1d0243 100644 --- a/src/mongo/db/session.h +++ b/src/mongo/db/session.h @@ -358,6 +358,11 @@ public: return _singleTransactionStats; } + repl::OpTime getSpeculativeTransactionReadOpTimeForTest() const { + stdx::lock_guard<stdx::mutex> lk(_mutex); + return _speculativeTransactionReadOpTime; + } + /** * If this session is holding stashed locks in _txnResourceStash, reports the current state of * the session using the provided builder. Locks the session object's mutex while running. @@ -377,6 +382,14 @@ public: */ BSONObj reportStashedState() const; + /** + * This method returns a string with information about a slow transaction. The format of the + * logging string produced should match the format used for slow operation logging. A + * transaction must be completed (committed or aborted) and a valid LockStats reference must be + * passed in order for this method to be called. + */ + std::string transactionInfoForLog(const SingleThreadedLockStats* lockStats); + void addMultikeyPathInfo(MultikeyPathInfo info) { _multikeyPathInfo.push_back(std::move(info)); } |