-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.6.10
-
Component/s: Replication
-
None
-
ALL
-
-
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:
- Restarting the affected mongod(s).
- 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).