[SERVER-11993] mongos doesn't accept write concern when index is created with insert command Created: 06/Dec/13  Updated: 11/Jul/16  Resolved: 02/Jan/14

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 2.5.5

Type: Bug Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Clients can use a write concern when inserting into the system.indexes collection on mongos using OP_INSERT and getlasterror, but mongos doesn't accept a writeConcern field for inserts into system.indexes with the insert command:

mongos> db.serverBuildInfo().version
2.5.5-pre-
mongos> db.serverBuildInfo().gitVersion
ed76da14b416376045dfe84cf3ad5866bd4feb1f
mongos> db.system.indexes.insert({key: {k: 1}, ns: 'test.collection', name: 'name'})
mongos> db.getLastError(2)
null
mongos> db.collection.drop()
true
mongos> db.runCommand({insert: 'system.indexes', documents: [{key: {k: 1}, ns: 'test.collection', name: 'name'}], writeConcern: {w: 2}})
{
	"ok" : 0,
	"code" : 72,
	"errmsg" : "invalid batch request for index creation"
}

Creating an index on mongod with an insert command and writeConcern behaves as expected: the command blocks until the index is built on N replicas.



 Comments   
Comment by Githook User [ 02/Jan/14 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-11993 mongos doesn't accept write concern when index is created with insert command
Branch: master
https://github.com/mongodb/mongo/commit/044bbff557853c9a4dac9018622ccbc7aaba9f99

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