[SERVER-24738] Config servers incorrectly allow w:1 writes if no write concern is specified Created: 22/Jun/16  Updated: 06/Dec/22  Resolved: 19/Dec/19

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

Type: Bug Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-24737 CSRS can accept non { w: 'majority' }... Closed
Related
related to SERVER-20891 User-initiated writes to the config s... Closed
related to SERVER-20577 Shell should default to read concern ... Closed
is related to SERVER-25894 _configsvrAddShard needs to be run wi... Closed
is related to SERVER-25778 Provide a generic mechanism for comma... Backlog
Assigned Teams:
Sharding
Operating System: ALL
Sprint: Sharding 18 (08/05/16)
Participants:

 Description   

SERVER-20891 tried to enforce that all writes to the config server use w:majority write concern. It, however, neglects to check the case where no write concern is specified at all. Thus you get the following behavior when writing to a config server:

> db.foo.insert({a:1}, {writeConcern: {w:1}})
WriteResult({
	"writeError" : {
		"code" : 2,
		"errmsg" : "w: 'majority' is the only valid write concern when writing to config server replica sets, got: { w: 1, wtimeout: 0 }"
	}
})
> db.foo.insert({a:1})
WriteResult({ "nInserted" : 1 })



 Comments   
Comment by Sheeri Cabral (Inactive) [ 19/Dec/19 ]

Users shouldn't be writing to the config servers; internal is all w:majority.

Comment by Spencer Brody (Inactive) [ 31/Aug/16 ]

It looks like we automatically apply a w:majority write concern to all commands run against a config server that don't specify an explicit write concern, which may make this unnecessary.

Generated at Thu Feb 08 04:07:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.