[SERVER-12069] Better error message when specifying a 'w' number write concern in user management commands on mongos Created: 12/Dec/13  Updated: 10/Dec/14  Resolved: 02/Apr/14

Status: Closed
Project: Core Server
Component/s: Security, Sharding, Usability
Affects Version/s: 2.5.4
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Spencer Brody (Inactive) Assignee: Spencer Brody (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-13085 Improve error message when using crea... Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

All user and role data in a sharded system lives on the config servers, so write concern for user and role management commands doesn't really make sense. Specifying "majority" has been special cased to be the same as w:1 when talking to config servers, but if you specify a w>1 you get an error message that just says "norepl". Not only is this a vague error message, but the command result will return ok:0, when in fact the write will likely have succeeded.

This is likely to cause confusion for users who are used to specifying a numeric write concern in user management commands without issue when talking to a replica set, but discover problems when doing the same thing on a sharded system. This is made all the more confusing by the fact that doing user or role manipulation on a non-admin database actually results in a write to the config servers, which may not be immediately obvious, especially in multi-tenant scenarios.

We should probably detect write concerns that don't make sense when talking to the config servers and fail with a more descriptive error message, before doing the write.



 Comments   
Comment by Spencer Brody (Inactive) [ 02/Apr/14 ]

Fixed by switching to write commands and by the work in SERVER-13085

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