[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: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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: (cherry picked from commit 1447252f5f44e4a2df4b7e38d4bdef0d88e526c4) |
| Comment by Githook User [ 05/Jul/18 ] |
|
Author: {'username': 'jinichu', 'name': 'jinichu', 'email': 'jinnybyun@gmail.com'}Message: |
| 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 |
| Comment by William Schultz (Inactive) [ 06/Jun/18 ] |
|
tess.avitabile That was already done in |
| 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? |