diff options
author | Eric Milkie <milkie@10gen.com> | 2014-09-26 16:32:32 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2014-09-26 16:32:41 -0400 |
commit | aa656086587c2c5513d884614ae55a38ec838df3 (patch) | |
tree | 9035800ada944d4626d7aa52729f44635e3a5a4b | |
parent | aeb26b131e973c5215eeff56b0d0e90e7c46a928 (diff) | |
download | mongo-aa656086587c2c5513d884614ae55a38ec838df3.tar.gz |
SERVER-15089 fix REMOVED nodes disconnecting sync source connections too early
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/repl/repl_set_impl.cpp | 11 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 832d4352ba4..9a5e71cfb61 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -435,7 +435,6 @@ namespace { void BackgroundSync::clearSyncTarget() { boost::unique_lock<boost::mutex> lock(_mutex); - _syncSourceReader.resetConnection(); _syncSourceHost = HostAndPort(); } diff --git a/src/mongo/db/repl/repl_set_impl.cpp b/src/mongo/db/repl/repl_set_impl.cpp index ee6e5f240d0..7bd3ff2d325 100644 --- a/src/mongo/db/repl/repl_set_impl.cpp +++ b/src/mongo/db/repl/repl_set_impl.cpp @@ -566,15 +566,16 @@ namespace { // kill off rsHealthPoll threads (because they Know Too Much about our past) endOldHealthTasks(); + // clear sync target to avoid faulty sync attempts; we must do this before we + // close sockets, since that will trigger the bgsync thread to reconnect. + BackgroundSync::get()->clearSyncTarget(); + // close sockets to force clients to re-evaluate this member MessagingPort::closeAllSockets(0); // take note of our ejection changeState(MemberState::RS_REMOVED); - // clear sync target to avoid faulty sync attempts - BackgroundSync::get()->clearSyncTarget(); - // go into holding pattern log() << "replSet info self not present in the repl set configuration:" << rsLog; log() << c.toString() << rsLog; @@ -857,9 +858,9 @@ namespace { } if (!_loadConfigFinish(txn, configs.mutableVector())) { - log() << "replSet info Couldn't load config yet. Sleeping 20sec and will try " + log() << "replSet info Couldn't load config yet. Sleeping 3 sec and will try " "again." << rsLog; - sleepsecs(20); + sleepsecs(3); continue; } } |