Explicit GLE calls fail after getLastErrorDefaults removed

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.10
    • Component/s: Replication
    • None
    • ALL
    • Hide
      1. Start replset (single member) (with a value for settings.getLastErrorDefault, or reconfig to set a value for it).
      2. Reconfig to remove the settings.getLastErrorDefault value.
      3. Do a test write.
      4. db.getLastErrorObj() fails with errmsg: "write concern object cannot be empty". Expected result is success.
      Show
      Start replset (single member) (with a value for settings.getLastErrorDefault, or reconfig to set a value for it). Reconfig to remove the settings.getLastErrorDefault value. Do a test write. db.getLastErrorObj() fails with errmsg: "write concern object cannot be empty". Expected result is success.
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When a replset contains a default write concern via getLastErrorDefaults, if the set is reconfigured to then remove this, explicit calls to getLastError will fail with:

       {
              "lastOp" : Timestamp(1431320964, 3),
              "connectionId" : 1,
              "n" : 0,
              "badGLE" : {
      
              },
              "ok" : 0,
              "errmsg" : "write concern object cannot be empty",
              "code" : 9
      }
      

      Write commands are unaffected, and work as expected.

      Effective workarounds are:

      1. Restarting the affected mongod(s).
      2. Re-adding getLastErrorDefaults as { w: 1 }

      Stepping down the primary is NOT a workaround (the new primary will have the same problem).

      Reproducer jstest attached.

      This doesn't affect 2.4.x (reason unknown), or 3.0.x/3.1.x (because in those versions, replset configs always explicitly include all options).

            Assignee:
            Unassigned
            Reporter:
            Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: