summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbcommands.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-04-22 11:35:44 -0400
committerEric Milkie <milkie@10gen.com>2013-06-03 14:26:40 -0400
commitb9225432a8d6a5ee11353f78e5df74df9b3c6451 (patch)
treee3ac89a1009f0a5754d18fc29519d6438cd84fa0 /src/mongo/db/dbcommands.cpp
parent819500d00d46fe0e69ce4cfb4398f04ce79b8471 (diff)
downloadmongo-b9225432a8d6a5ee11353f78e5df74df9b3c6451.tar.gz
SERVER-9417 opReplicatedEnough should assert on step down
Conflicts: src/mongo/db/dbcommands.cpp
Diffstat (limited to 'src/mongo/db/dbcommands.cpp')
-rw-r--r--src/mongo/db/dbcommands.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 8d1eec45eb0..9a1bfca0228 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -241,6 +241,13 @@ namespace mongo {
break;
}
+ if ( !_isMaster() ) {
+ // this should be in the while loop in case we step down
+ errmsg = "not master";
+ result.append( "wnote", "no longer primary" );
+ return false;
+ }
+
// check this first for w=0 or w=1
if ( opReplicatedEnough( op, e ) ) {
break;