summaryrefslogtreecommitdiff
path: root/src/mongo/db/instance.cpp
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2014-02-18 15:09:25 -0500
committerAndy Schwerin <schwerin@10gen.com>2014-02-19 14:57:34 -0500
commit548693879eddfe3051a7303245dcfedde3a0ac61 (patch)
treebf642d393d570c5c33442c5062df5c4db73657fd /src/mongo/db/instance.cpp
parent637ca318fd8df656931591214fccaf219616fd91 (diff)
downloadmongo-548693879eddfe3051a7303245dcfedde3a0ac61.tar.gz
SERVER-12516 Check for change in primary state when recovering from yield in CRUD operations.
Without this patch, a replicaset member running a long-running write operation that yields might not notice, on yield recovery, that the node is no longer a primary, and so no longer entitled to perform writes.
Diffstat (limited to 'src/mongo/db/instance.cpp')
-rw-r--r--src/mongo/db/instance.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp
index b081f1d7906..3aada48a438 100644
--- a/src/mongo/db/instance.cpp
+++ b/src/mongo/db/instance.cpp
@@ -612,10 +612,6 @@ namespace mongo {
Lock::DBWrite lk(ns.ns());
- // void ReplSetImpl::relinquish() uses big write lock so this is thus
- // synchronized given our lock above.
- uassert( 17010 , "not master", isMasterNs( ns.ns().c_str() ) );
-
// if this ever moves to outside of lock, need to adjust check
// Client::Context::_finishInit
if ( ! broadcast && handlePossibleShardedMessage( m , 0 ) )
@@ -652,10 +648,7 @@ namespace mongo {
while ( 1 ) {
try {
Lock::DBWrite lk(ns.ns());
-
- // writelock is used to synchronize stepdowns w/ writes
- uassert( 10056 , "not master", isMasterNs( ns.ns().c_str() ) );
-
+
// if this ever moves to outside of lock, need to adjust check Client::Context::_finishInit
if ( ! broadcast && handlePossibleShardedMessage( m , 0 ) )
return;