Shell's connection object with retryable writes enabled does not pass `txnNumber` for removes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.6.0-rc0
    • Component/s: Testing Infrastructure
    • None
    • ALL
    • Hide

      Create a new client, run insert and remove and inspect the contents of the oplog:

      var dbWithSession = new Mongo('localhost:20000').startSession({retryWrites:true}).getDatabase('TestDB');
      

      For inserts:

      dbWithSession.insert({_id: 1});
      

      The oplog contains lsid/txnNumber information:

      {
              "ts" : Timestamp(1508263733, 1),
              "t" : NumberLong(1),
              "h" : NumberLong("5813089571967450467"),
              "v" : 2,
              "op" : "i",
              "ns" : "TestDB.TestColl",
              "ui" : UUID("e551162e-21a0-4c90-82e5-9e6ea239ef1f"),
              "wall" : ISODate("2017-10-17T18:08:53.938Z"),
              "lsid" : {
                      "id" : UUID("62f09f8b-5f90-4a5c-9c39-708923793815"),
                      "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
              },
              "txnNumber" : NumberLong(0),
              "stmtId" : 0,
              "prevOpTime" : {
                      "ts" : Timestamp(0, 0),
                      "t" : NumberLong(-1)
              },
              "o" : {
                      "_id" : 1
              }
      }
      

      For removes:

      dbWithSession.TestColl.remove({_id: 0});
      

      It doesn't:

      {
              "ts" : Timestamp(1508263783, 1),
              "t" : NumberLong(1),
              "h" : NumberLong("6684227120267171736"),
              "v" : 2,
              "op" : "d",
              "ns" : "TestDB.TestColl",
              "ui" : UUID("e551162e-21a0-4c90-82e5-9e6ea239ef1f"),
              "wall" : ISODate("2017-10-17T18:09:43.947Z"),
              "o" : {
                      "_id" : 1
              }
      }
      
      Show
      Create a new client, run insert and remove and inspect the contents of the oplog: var dbWithSession = new Mongo( 'localhost:20000' ).startSession({retryWrites: true }).getDatabase( 'TestDB' ); For inserts: dbWithSession.insert({_id: 1}); The oplog contains lsid/txnNumber information: { "ts" : Timestamp(1508263733, 1), "t" : NumberLong(1), "h" : NumberLong("5813089571967450467"), "v" : 2, "op" : "i", "ns" : "TestDB.TestColl", "ui" : UUID("e551162e-21a0-4c90-82e5-9e6ea239ef1f"), "wall" : ISODate("2017-10-17T18:08:53.938Z"), "lsid" : { "id" : UUID("62f09f8b-5f90-4a5c-9c39-708923793815"), "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=") }, "txnNumber" : NumberLong(0), "stmtId" : 0, "prevOpTime" : { "ts" : Timestamp(0, 0), "t" : NumberLong(-1) }, "o" : { "_id" : 1 } } For removes: dbWithSession.TestColl.remove({_id: 0}); It doesn't: { "ts" : Timestamp(1508263783, 1), "t" : NumberLong(1), "h" : NumberLong("6684227120267171736"), "v" : 2, "op" : "d", "ns" : "TestDB.TestColl", "ui" : UUID("e551162e-21a0-4c90-82e5-9e6ea239ef1f"), "wall" : ISODate("2017-10-17T18:09:43.947Z"), "o" : { "_id" : 1 } }
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The remove operation on a shell connection object with sessions enabled does not pass txnNumber. See the steps to reproduce for more information.

            Assignee:
            Max Hirschhorn
            Reporter:
            Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: