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

Config servers incorrectly allow w:1 writes if no write concern is specified

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Sharding
    • ALL
    • Sharding 18 (08/05/16)

      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 })
      

            Assignee:
            backlog-server-sharding [DO NOT USE] Backlog - Sharding Team
            Reporter:
            spencer@mongodb.com Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: