diff options
author | Geert Bosch <geert@mongodb.com> | 2017-08-31 14:00:04 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2017-08-31 18:10:56 -0400 |
commit | 8f777fa25140ca11573a8df0287734af107e9d5a (patch) | |
tree | ddd5b02df38e59deed45bb4c10facc539c022be4 /src/mongo/db/repl/initial_syncer.cpp | |
parent | d978f42d9143fdf59f4e8ffc720f88ba56dfd20c (diff) | |
download | mongo-8f777fa25140ca11573a8df0287734af107e9d5a.tar.gz |
SERVER-30913 remove unused getLatestOplogEntry method from initial_syncer
Diffstat (limited to 'src/mongo/db/repl/initial_syncer.cpp')
-rw-r--r-- | src/mongo/db/repl/initial_syncer.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index 9c77306ef0b..2f438ec436c 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -150,49 +150,6 @@ StatusWith<Timestamp> parseTimestampStatus(const QueryResponseStatus& fetchResul } } -StatusWith<BSONObj> getLatestOplogEntry(executor::TaskExecutor* exec, - HostAndPort source, - const NamespaceString& oplogNS) { - BSONObj query = - BSON("find" << oplogNS.coll() << "sort" << BSON("$natural" << -1) << "limit" << 1); - - BSONObj entry; - Status statusToReturn(Status::OK()); - Fetcher fetcher( - exec, - source, - oplogNS.db().toString(), - query, - [&entry, &statusToReturn](const QueryResponseStatus& fetchResult, - Fetcher::NextAction* nextAction, - BSONObjBuilder*) { - if (!fetchResult.isOK()) { - statusToReturn = fetchResult.getStatus(); - } else { - const auto docs = fetchResult.getValue().documents; - invariant(docs.size() < 2); - if (docs.size() == 0) { - statusToReturn = {ErrorCodes::OplogStartMissing, "no oplog entry found."}; - } else { - entry = docs.back().getOwned(); - } - } - }); - Status scheduleStatus = fetcher.schedule(); - if (!scheduleStatus.isOK()) { - return scheduleStatus; - } - - // wait for fetcher to get the oplog position. - fetcher.join(); - if (statusToReturn.isOK()) { - LOG(2) << "returning last oplog entry: " << redact(entry) << ", from: " << source - << ", ns: " << oplogNS; - return entry; - } - return statusToReturn; -} - StatusWith<OpTimeWithHash> parseOpTimeWithHash(const QueryResponseStatus& fetchResult) { if (!fetchResult.isOK()) { return fetchResult.getStatus(); |