[SERVER-34692] Move txnNumber in currentOp to subdocument Created: 26/Apr/18  Updated: 29/Oct/23  Resolved: 16/May/18

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 3.7.5
Fix Version/s: 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Bruce Lucas (Inactive) Assignee: Xiangyu Yao (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-12404 Docs for SERVER-34692: Move txnNumber... Closed
Related
is related to SERVER-35173 Add autocommit value to transaction s... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Storage NYC 2018-05-21
Participants:

 Description   

Currently txnNumber for inactive transactions is reported at the top level of each operation document, but it should be contained in a nested document like so:

{
    transaction: {
        parameters: {
            txnNumber: ...
        }
    }
}



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

Author:

{'email': 'xiangyu.yao@mongodb.com', 'username': 'xy24', 'name': 'Xiangyu Yao'}

Message: SERVER-34692 Move txnNumber to subdocument in currentOp
Branch: master
https://github.com/mongodb/mongo/commit/7cbc98eb835b4613e171ff11b567de3528d2ff6b

Comment by Bruce Lucas (Inactive) [ 15/May/18 ]

On further reflection, I don't think it's valuable enough to have all transaction parameters in one place to duplicate it, and duplicating it would look odd and raise questions ("can the two be different?"), particularly in mongod log entries. I'm inclined to say let's just keep it at the top level, both in currentOp and mongod log. We can always add it to transaction.parameters later if we discover it would be useful.

Comment by Spencer Brody (Inactive) [ 14/May/18 ]

Agree with James. Sessions are going to be used more-and-more over time, so including them for all operations seems valuable. If we think it's valuable to also have all txn-related arguments in one place, then duplicating it seems acceptable.

Comment by James Wahlin [ 11/May/18 ]

lsid is included in currentOp, profiler and the slow operation logging. 

I think it would be fine to include lsid at both the top-level and within transaction.parameters if it is useful to do so. We should definitely include at the top-level to allow users to filter/order/group currentOp output by session for all session operations.

Comment by Bruce Lucas (Inactive) [ 11/May/18 ]

james.wahlin, I'm not sure. There are two goals of the current design:

  • collect all the parameters for a transaction into a single place
  • consistency between the slow transaction logging and the currentOp document. Current slow transaction log line design includes the following:

    parameters:{lsid:..., txnNumber:..., readConcern:..., autocommit:...},
    

We could

  • move lsid to the top level
  • duplicate lsid at top level, and in transaction.parameters in cases where the op is part of a transaction

Do we currently include lsid in 1) currentOp and 2) logged slow transactions?

Comment by Xiangyu Yao (Inactive) [ 10/May/18 ]

james.wahlin Thanks! I deleted the CR which the previous link points to.

Comment by James Wahlin [ 10/May/18 ]

bruce.lucas / xiangyu.yao - LogicalSessionId ('lsid') is a requirement for transactions but not exclusive to them. We should display this whenever an operation is run as part of a session and the location in the currentOp document should be the same for both to allow for easy filtering. Given that should we leave 'lsid' as a top-level field rather than nest within a transaction specific sub-document?

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