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

In sharded clusters on failed insert GLE sometimes returns null err field

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.2, 2.3.1
    • Component/s: Sharding
    • None
    • ALL
    • Hide

      see attached

      Show
      see attached

      When doing an insert into a sharded collection because of SERVER-4381 but in attached testcase it does not properly set "err:" field and "code:" field when writeback listeners are involved.

      Before fix for SERVER-4532 and SERVER-7958 the attached code would set err: but not code: fields (so it would fail in the first failed asserts before split/migration) however testing it with both of those fixes now it returns proper GLE before split/migrate but after returns:

      assert failed : Insert of a duplicate record after split/migrate did not create correct GLE{
      "singleShard" : "localhost:30000",
      "n" : 0,
      "connectionId" : 21,
      "err" : null,
      "ok" : 1,
      "code" : 11000,
      "writebackGLE" :

      { "singleShard" : "localhost:30000", "n" : 0, "connectionId" : 21, "err" : null, "ok" : 1 }

      ,
      "initialGLEHost" : "localhost:30000",
      "initialGLE" : {
      "err" : "E11000 duplicate key error index: test.trans.$owner_1 dup key: { : 1234567890 }",
      "code" : 11000,
      "n" : 0,
      "connectionId" : 16,
      "ok" : 1
      }
      }

        1. dupBadNoErr.js
          3 kB
          Asya Kamsky

            Assignee:
            Unassigned Unassigned
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: