diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2014-07-07 05:54:28 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2014-07-08 07:39:33 -0400 |
commit | 3a957f6e61d8cacacf0cfe4bdceb5dbc2f3ef628 (patch) | |
tree | f6b8d8d676e3f460060a84dc9d87d7a2d2f0b6a9 /src | |
parent | 7562ef733c81d20d4a6a7849ad6a7c70713c117e (diff) | |
download | mongo-3a957f6e61d8cacacf0cfe4bdceb5dbc2f3ef628.tar.gz |
SERVER-14499 eliminate ReplicationStartSynchronizer
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/index_rebuilder.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/repl/repl_set_impl.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/repl/repl_set_impl.h | 9 | ||||
-rw-r--r-- | src/mongo/db/repl/rs.cpp | 1 |
4 files changed, 2 insertions, 20 deletions
diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp index 29b594dd1e4..40279fb82f4 100644 --- a/src/mongo/db/index_rebuilder.cpp +++ b/src/mongo/db/index_rebuilder.cpp @@ -37,7 +37,6 @@ #include "mongo/db/catalog/database_catalog_entry.h" #include "mongo/db/client.h" #include "mongo/db/instance.h" -#include "mongo/db/repl/rs.h" #include "mongo/db/operation_context_impl.h" #include "mongo/db/storage/storage_engine.h" #include "mongo/util/log.h" @@ -79,9 +78,6 @@ namespace mongo { catch (const DBException& e) { warning() << "Index rebuilding did not complete: " << e.what() << endl; } - boost::unique_lock<boost::mutex> lk(repl::ReplSet::rss.mtx); - repl::ReplSet::rss.indexRebuildDone = true; - repl::ReplSet::rss.cond.notify_all(); LOG(1) << "checking complete" << endl; } diff --git a/src/mongo/db/repl/repl_set_impl.cpp b/src/mongo/db/repl/repl_set_impl.cpp index 6afe4849eef..9450d5c58bb 100644 --- a/src/mongo/db/repl/repl_set_impl.cpp +++ b/src/mongo/db/repl/repl_set_impl.cpp @@ -34,6 +34,7 @@ #include "mongo/db/catalog/database.h" #include "mongo/db/commands/get_last_error.h" #include "mongo/db/dbhelpers.h" +#include "mongo/db/index_rebuilder.h" #include "mongo/db/operation_context_impl.h" #include "mongo/db/repl/bgsync.h" #include "mongo/db/repl/connections.h" @@ -469,12 +470,7 @@ namespace { // call after constructing to start - returns fairly quickly after launching its threads void ReplSetImpl::_go() { - { - boost::unique_lock<boost::mutex> lk(rss.mtx); - while (!rss.indexRebuildDone) { - rss.cond.wait(lk); - } - } + indexRebuilder.wait(); try { loadLastOpTimeWritten(); } diff --git a/src/mongo/db/repl/repl_set_impl.h b/src/mongo/db/repl/repl_set_impl.h index 7089bd3fef1..cbeef0fe08e 100644 --- a/src/mongo/db/repl/repl_set_impl.h +++ b/src/mongo/db/repl/repl_set_impl.h @@ -51,14 +51,6 @@ namespace repl { class ReplSetSeedList; class ReplSetHealthPollTask; - class ReplicationStartSynchronizer { - public: - ReplicationStartSynchronizer() : indexRebuildDone(false) {} - boost::mutex mtx; - bool indexRebuildDone; - boost::condition cond; - }; - // information about the entire replset, such as the various servers in the set, and their state /* note: We currently do not free mem when the set goes away - it is assumed the replset is a singleton and long lived. @@ -73,7 +65,6 @@ namespace repl { static StartupStatus startupStatus; static DiagStr startupStatusMsg; static string stateAsHtml(MemberState state); - static ReplicationStartSynchronizer rss; /* todo thread */ void msgUpdateHBInfo(HeartbeatInfo); diff --git a/src/mongo/db/repl/rs.cpp b/src/mongo/db/repl/rs.cpp index 9970f3697b7..de4b06fb91a 100644 --- a/src/mongo/db/repl/rs.cpp +++ b/src/mongo/db/repl/rs.cpp @@ -69,7 +69,6 @@ namespace repl { ReplSetImpl::StartupStatus ReplSetImpl::startupStatus = PRESTART; DiagStr ReplSetImpl::startupStatusMsg; - ReplicationStartSynchronizer ReplSetImpl::rss; void ReplSet::haveNewConfig(ReplSetConfig& newConfig, bool addComment) { bo comment; |