[SERVER-18406] Explicit GLE calls fail after getLastErrorDefaults removed Created: 11/May/15  Updated: 22/Jun/15  Resolved: 22/Jun/15

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.6.10
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kevin Pulo Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File getLastErrorDefaults_remove.js    
Issue Links:
Related
Operating System: ALL
Steps To Reproduce:
  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.
Participants:

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



 Comments   
Comment by Eric Milkie [ 22/Jun/15 ]

This is an odd, rare problem in a now-legacy version, and therefore not worth the effort to fix. The workaround is to upgrade to 3.0 or later.

Generated at Thu Feb 08 03:47:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.