[SERVER-35173] Add autocommit value to transaction sub-document of currentOp Created: 22/May/18  Updated: 29/Oct/23  Resolved: 05/Jul/18

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

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

Issue Links:
Backports
Depends
is depended on by SERVER-35174 Add readConcern and readTimestamp to ... Closed
is depended on by SERVER-35302 Add startWallClockTime to the transac... Closed
is depended on by SERVER-35305 Add timeOpenMicros to the transaction... Closed
is depended on by SERVER-35310 Add timeActiveMicros and timeInactive... Closed
is depended on by SERVER-35457 Add transaction expiry time to transa... Closed
Documented
is documented by DOCS-12405 Docs for SERVER-35173: Add autocommit... Closed
Problem/Incident
causes SERVER-36007 Attempting to check out an already ch... Closed
Related
related to SERVER-34692 Move txnNumber in currentOp to subdoc... Closed
is related to SERVER-35174 Add readConcern and readTimestamp to ... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Repl 2018-06-18, Repl 2018-07-02, Repl 2018-07-16
Participants:

 Description   

We want the currentOp entry for both active and inactive transactions to contain an entry with a transaction.parameters sub document that contains the autocommit parameter for that transaction.

For active transactions, we want to make sure that the CurOp::reportCurrentOpForClient method attaches this information to the appropriate sub-document, and for inactive transactions, we want to make sure that the Session::reportStashedState method also attaches it.



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

Author:

{'username': 'jinichu', 'email': 'jinnybyun@gmail.com', 'name': 'jinichu'}

Message: SERVER-35173 Added autocommit value to currentOp's transaction sub-document

(cherry picked from commit 1447252f5f44e4a2df4b7e38d4bdef0d88e526c4)
Branch: v4.0
https://github.com/mongodb/mongo/commit/a9ae61e976af1fecbf0779a03f400d685e6e58f6

Comment by Githook User [ 05/Jul/18 ]

Author:

{'username': 'jinichu', 'name': 'jinichu', 'email': 'jinnybyun@gmail.com'}

Message: SERVER-35173 Added autocommit value to currentOp's transaction sub-document
Branch: master
https://github.com/mongodb/mongo/commit/1447252f5f44e4a2df4b7e38d4bdef0d88e526c4

Comment by William Schultz (Inactive) [ 28/Jun/18 ]

This ticket has grown to include the addition of a Session::reportUnstashedState method that gets called from PipelineD::MongoDInterface::_reportCurrentOpForClient, and returns stats about an active transaction. This means that other tickets about adding transaction fields to currentOp for active transactions are now dependent on this ticket.

Comment by William Schultz (Inactive) [ 07/Jun/18 ]

To access the autocommit parameter for a transaction, we must access the Session object. As it stands now, curop.cpp is linked into mongos, and CurOp::reportCurrentOpForClient is called both on mongod and mongos. The SessionCatalog and Session object don't exist on mongos, though. I think that for this ticket we should append the transaction specific parameters at the layer above, in PipelineD::MongoDInterface::_reportCurrentOpForClient, which is mongod specific, where we should be able to access the SessionCatalog.

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

Note that the comment thread on SERVER-34692 indicates that it would be too confusing to duplicate the lsid at the top level of currentOp and the transaction sub-document. Therefore, we are leaving lsid only at the top level currentOp output, where it already exists currently.

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

tess.avitabile That was already done in SERVER-34692.

Comment by Tess Avitabile (Inactive) [ 06/Jun/18 ]

Should we also move the txnNumber into the sub-document as part of this work?

Comment by Eric Milkie [ 22/May/18 ]

Perfect, thank you.

Comment by William Schultz (Inactive) [ 22/May/18 ]

milkie I updated the description and title. Does this make more sense? The goal of the ticket is to move the lsid into the sub-document, and add the autocommit field.

Comment by Eric Milkie [ 22/May/18 ]

I'm not clear on what the work for this ticket will be. Do we suspect that the code is currently incorrect?

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