Shouldn't allow w:0 in replset getLastErrorDefaults

XMLWordPrintableJSON

    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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 (Inactive)
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: