Skip to content

Commit

Permalink
this breaks a lot of tests
Browse files Browse the repository at this point in the history
not sure of right behavior
Revert "we should allow w:majority for a single mongod instance"

This reverts commit 3f55adc.
  • Loading branch information
erh committed Oct 17, 2012
1 parent 0313d5e commit a1d1cc6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/mongo/db/dbcommands.cpp
Expand Up @@ -157,7 +157,6 @@ namespace mongo {
<< " { fsync:true } - fsync before returning, or wait for journal commit if running with --journal\n"
<< " { j:true } - wait for journal commit if running with --journal\n"
<< " { w:n } - await replication to n servers (including self) before returning\n"
<< " { w:'majority' } - await replication to majority of set\n"
<< " { wtimeout:m} - timeout for w in m milliseconds";
}
bool run(const string& dbname, BSONObj& _cmdObj, int, string& errmsg, BSONObjBuilder& result, bool fromRepl) {
Expand Down Expand Up @@ -232,17 +231,16 @@ namespace mongo {
if ( anyReplEnabled() ) {
result.append( "wnote" , "no write has been done on this connection" );
}
else if ( e.numberInt() > 1 ) {
else if ( e.isNumber() && e.numberInt() <= 1 ) {
// don't do anything
// w=1 and no repl, so this is fine
}
else {
// w=2 and no repl
result.append( "wnote" , "no replication has been enabled, so w=2+ won't work" );
result.append( "err", "norepl" );
return true;
}
else {
// don't do anything
// w=1 and no repl, so this is fine
// w:majority lands here too
}

result.appendNull( "err" );
return true;
Expand Down

0 comments on commit a1d1cc6

Please sign in to comment.