Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2931

Add a way to get txnNumber from mongo.Session

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sessions
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Summary

      In mongosync, I want to be able to log the lsid and txnNumber of a transaction so I can easily search for problematic transactions in the oplog. Currently I can get the lsid from Session.ID() but that is not enough to uniquely identify a transaction.

      I was thinking something like this:

      func (s *sessionImpl) TxnNumber() int64 {
           return s.clientSession.TxnNumber 
      } 

      And add TxnNumber() to the Session interface.

      We already have Session.ID() so I think there is precedence for providing this kind of info in the public API for Session.

      If we cannot get the txnNumber from the stable API, I would settle for a way to make the Go driver log it.

      Motivation

      Who is the affected end user?

      TAR Team

      How does this affect the end user?

      Debugging BFs is greatly slowing our velocity. Improving our ability to debug will allow us to ship features quicker.

      How likely is it that this problem or use case will occur?

      Associating operations in logs with operations on the server is a common problem we face.

      If the problem does occur, what are the consequences and how severe are they?

      Lost time on debugging.

      Is this issue urgent?

      This is causing pain now so would be nice to discuss solutions soon.

      Is this ticket required by a downstream team?

      TAR

      Is this ticket only for tests?

      Just for test improvements.

      Cast of Characters

      Engineering Lead:
      Document Author:
      POCers:
      Product Owner:
      Program Manager:
      Stakeholders:

      Channels & Docs

       

            Assignee:
            preston.vasquez@mongodb.com Preston Vasquez
            Reporter:
            tim.fogarty@mongodb.com Tim Fogarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: