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

Shouldn't allow w:0 in replset getLastErrorDefaults

      Example showing it is currently allowed:

      > rs.initiate()
      {
              "info2" : "no configuration explicitly specified -- making one",
              "me" : "redbeard:27017",
              "info" : "Config now saved locally.  Should come online in about a minute.",
              "ok" : 1
      }
      foo:PRIMARY> conf = rs.conf()
      {
              "_id" : "foo",
              "version" : 1,
              "members" : [
                      {
                              "_id" : 0,
                              "host" : "redbeard:27017"
                      }
              ]
      }
      foo:PRIMARY> conf.settings = {getLastErrorDefaults: {w:0}}
      { "getLastErrorDefaults" : { "w" : 0 } }
      foo:PRIMARY> conf
      {
              "_id" : "foo",
              "version" : 1,
              "members" : [
                      {
                              "_id" : 0,
                              "host" : "redbeard:27017"
                      }
              ],
              "settings" : {
                      "getLastErrorDefaults" : {
                              "w" : 0
                      }
              }
      }
      foo:PRIMARY> rs.reconfig(conf)
      { "ok" : 1 }
      foo:PRIMARY> rs.conf()
      {
              "_id" : "foo",
              "version" : 2,
              "members" : [
                      {
                              "_id" : 0,
                              "host" : "redbeard:27017"
                      }
              ],
              "settings" : {
                      "getLastErrorDefaults" : {
                              "w" : 0
                      }
              }
      }
      

            Assignee:
            matt.dannenberg Matt Dannenberg
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: