-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.2.3, 3.3.1
-
Component/s: Sharding
-
None
-
ALL
-
Sharding 11 (03/11/16)
-
0
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
Majority writes, which succeed doing the local write, but fail to wait for write concern will return 'ok: 1', but will contain a writeConcern section:
testReplSet:PRIMARY> db.runCommand({ insert: 'TestColl', documents: [ { Key: 3, Value: 'Value 3' } ], writeConcern: { w: 'majority', wtimeout: 2000 } }); { "ok" : 1, "n" : 1, "opTime" : { "ts" : Timestamp(1455914253, 1), "t" : NumberLong(4) }, "electionId" : ObjectId("7fffffff0000000000000004"), "writeConcernError" : { "code" : 64, "errInfo" : { "wtimeout" : true }, "errmsg" : "waiting for replication timed out" } }
The sharding registry write commands should check for write concern failure and retry if necessary.