From b9225432a8d6a5ee11353f78e5df74df9b3c6451 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Mon, 22 Apr 2013 11:35:44 -0400 Subject: SERVER-9417 opReplicatedEnough should assert on step down Conflicts: src/mongo/db/dbcommands.cpp --- src/mongo/db/dbcommands.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mongo/db/dbcommands.cpp') 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; -- cgit v1.2.1