diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2014-04-23 06:13:55 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2014-04-29 05:43:03 -0400 |
commit | 9938f4c65aba762590385825fcf837a0dfc68733 (patch) | |
tree | 979c8b9dc6c6ba232cb0e035cd8233e7351d68d5 /src/mongo/db/repl/bgsync.cpp | |
parent | 24cc069b7f2733a926d83727878d11584c439e3b (diff) | |
download | mongo-9938f4c65aba762590385825fcf837a0dfc68733.tar.gz |
SERVER-13091 remove notifier thread
Diffstat (limited to 'src/mongo/db/repl/bgsync.cpp')
-rw-r--r-- | src/mongo/db/repl/bgsync.cpp | 64 |
1 files changed, 2 insertions, 62 deletions
diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 2db047dde95..0e68364ae11 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -91,8 +91,7 @@ namespace replset { _pause(true), _appliedBuffer(true), _assumingPrimary(false), - _currentSyncTarget(NULL), - _consumedOpTime(0, 0) { + _currentSyncTarget(NULL) { } BackgroundSync* BackgroundSync::get() { @@ -108,17 +107,7 @@ namespace replset { } void BackgroundSync::notify() { - { - boost::unique_lock<boost::mutex> lock(s_mutex); - if (s_instance == NULL) { - return; - } - } - - { - boost::unique_lock<boost::mutex> opLock(s_instance->_lastOpMutex); - s_instance->_lastOpCond.notify_all(); - } + theReplSet->syncSourceFeedback.updateSelfInMap(theReplSet->lastOpTimeWritten); { boost::unique_lock<boost::mutex> lock(s_instance->_mutex); @@ -131,55 +120,6 @@ namespace replset { } } - void BackgroundSync::notifierThread() { - Client::initThread("rsSyncNotifier"); - replLocalAuth(); - - theReplSet->syncSourceFeedback.go(); - - while (!inShutdown()) { - if (!theReplSet) { - sleepsecs(5); - continue; - } - - MemberState state = theReplSet->state(); - if (state.primary() || state.fatal() || state.startup()) { - sleepsecs(5); - continue; - } - - try { - { - boost::unique_lock<boost::mutex> lock(_lastOpMutex); - while (_consumedOpTime == theReplSet->lastOpTimeWritten) { - _lastOpCond.wait(lock); - } - } - - markOplog(); - } - catch (DBException &e) { - log() << "replset tracking exception: " << e.getInfo() << rsLog; - sleepsecs(1); - } - catch (std::exception &e2) { - log() << "replset tracking error" << e2.what() << rsLog; - sleepsecs(1); - } - } - - cc().shutdown(); - } - - void BackgroundSync::markOplog() { - LOG(3) << "replset markOplog: " << _consumedOpTime << " " - << theReplSet->lastOpTimeWritten << rsLog; - - _consumedOpTime = theReplSet->lastOpTimeWritten; - theReplSet->syncSourceFeedback.updateSelfInMap(theReplSet->lastOpTimeWritten); - } - void BackgroundSync::producerThread() { Client::initThread("rsBackgroundSync"); replLocalAuth(); |