|
On a recent build (589a52d8e) I can use replSetReconfig to put {w: 0} in getLastErrorDefaults. I think this was prohibited, as desired, earlier, but that it's regressed. I'm not certain though.
I start one mongod:
./mongod --nojournal --dbpath data --replSet rs
|
In the shell:
> use admin
|
switched to db admin
|
> rs.initiate({_id: 'rs', members: [{_id: 0, host: 'localhost:27017'}]})
|
{ "ok" : 1 }
|
rs:OTHER>
|
rs:PRIMARY> var conf = db.runCommand({replSetGetConfig: 1}).config;
|
rs:PRIMARY> conf
|
{
|
"_id" : "rs",
|
"version" : 1,
|
"members" : [
|
{
|
"_id" : 0,
|
"host" : "localhost:27017",
|
"arbiterOnly" : false,
|
"buildIndexes" : true,
|
"hidden" : false,
|
"priority" : 1,
|
"tags" : {
|
|
},
|
"slaveDelay" : 0,
|
"votes" : 1
|
}
|
],
|
"settings" : {
|
"chainingAllowed" : true,
|
"heartbeatTimeoutSecs" : 10,
|
"getLastErrorModes" : {
|
|
},
|
"getLastErrorDefaults" : {
|
"w" : 1,
|
"wtimeout" : 0
|
}
|
}
|
}
|
rs:PRIMARY> conf.settings = {getLastErrorDefaults: {w: 0}}
|
{ "getLastErrorDefaults" : { "w" : 0 } }
|
rs:PRIMARY> conf.version++
|
1
|
rs:PRIMARY> db.runCommand({replSetReconfig: conf})
|
{ "ok" : 1 }
|
rs:PRIMARY> db.runCommand({replSetGetConfig: 1}).config
|
{
|
"_id" : "rs",
|
"version" : 2,
|
"members" : [
|
{
|
"_id" : 0,
|
"host" : "localhost:27017",
|
"arbiterOnly" : false,
|
"buildIndexes" : true,
|
"hidden" : false,
|
"priority" : 1,
|
"tags" : {
|
|
},
|
"slaveDelay" : 0,
|
"votes" : 1
|
}
|
],
|
"settings" : {
|
"chainingAllowed" : true,
|
"heartbeatTimeoutSecs" : 10,
|
"getLastErrorModes" : {
|
|
},
|
"getLastErrorDefaults" : {
|
"w" : 0,
|
"wtimeout" : 0
|
}
|
}
|
}
|
rs:PRIMARY> db.serverBuildInfo()
|
{
|
"version" : "2.7.9-pre-",
|
"gitVersion" : "589a52d8e966cd11b568038fadb4a27c3ffbe835",
|
...
|
}
|
|
|
redbeard0531 and mattd@10gen.com, what's the expected behavior if I configure a 2.6 replica set with getLastErrorDefaults w:0, then upgrade to 2.8? How about if the current primary is 2.6 and secondaries are 2.8, and I issue a replicaSetReconfig to the primary with getLastErrorDefaults w:0?
|