Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-69233

Incorrect top-level tenant id in transactional oplog entry

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Server Serverless 2022-09-05, Server Serverless 2022-09-19

       

      The tenant id in the top level applyOps entry is incorrect. The top-level tenant id contains the kSystemTenatId and not the tenant id.

      For eg, the correct tenant id here is ObjectId("6308e6f7498ed88d8073b94a") and not ObjectId("156500000102030405060708"):

      {
              "lsid" : {
                  "id" : UUID("7d243c06-aac4-4f7f-b337-64e34f39c622"),
                  "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
              },
              "txnNumber" : NumberLong(0),
              "op" : "c",
              "tid" : ObjectId("156500000102030405060708"),
              "ns" : "admin.$cmd",
              "o" : {
                  "applyOps" : [
                      {
                          "op" : "c",
                          "tid" : ObjectId("6308e6f7498ed88d8073b94a"),
                          "ns" : "motill.$cmd",
                          "ui" : UUID("c2dd4c81-5557-4b80-8993-c700d090305f"),
                          "o" : {
                              "create" : "thedogss",
                              "idIndex" : {
                                  "v" : 2,
                                  "key" : {
                                      "_id" : 1
                                  },
                                  "name" : "_id_"
                              }
                          }
                      },

      The logApplyOps function hard codes the kSystemTenatId. This method should set the tenant id with the one in the nested applyOps entry. The applyOps block should be associated with only one tenant id as such it should be safe to extract the tenant id from the nested applyOps entry and set it to the top-level tenant id.

      The correct tenant id can be extracted from the operationIter and passed to the logApplyOps function.

       

            Assignee:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Reporter:
            rishab.joshi@mongodb.com Rishab Joshi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: