Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12069

Better error message when specifying a 'w' number write concern in user management commands on mongos

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.4
    • Component/s: Security, Sharding, Usability
    • Labels:
      None
    • Fully Compatible

      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.

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: