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

Explicit GLE calls fail after getLastErrorDefaults removed

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 2.6.10
    • 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.

    Description

      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).

      Attachments

        Activity

          People

            Unassigned Unassigned
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: