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

Shouldn't allow w:0 in replset getLastErrorDefaults

    XMLWordPrintable

    Details

      Description

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              matt.dannenberg Matt Dannenberg
              Reporter:
              redbeard0531 Mathias Stearn
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: