diff options
author | Andy Schwerin <schwerin@mongodb.com> | 2018-03-13 15:26:04 -0400 |
---|---|---|
committer | Andy Schwerin <schwerin@mongodb.com> | 2018-03-15 17:36:38 -0400 |
commit | a65df88a0d7ea660e5d87aa667c77c4d4a999bca (patch) | |
tree | 9f1e27cee480206243fddee60b0ce5797778aa10 /src/mongo/db/query/find.cpp | |
parent | e1418190f72787f9a21d5251ad6290076dbc4ae9 (diff) | |
download | mongo-a65df88a0d7ea660e5d87aa667c77c4d4a999bca.tar.gz |
SERVER-31802 Rip out more dead master-slave code, and the related concept of RID.
Diffstat (limited to 'src/mongo/db/query/find.cpp')
-rw-r--r-- | src/mongo/db/query/find.cpp | 42 |
1 files changed, 3 insertions, 39 deletions
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index fdd402b76bd..43d86c1beab 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -163,8 +163,7 @@ namespace { * * Returns the number of documents in the batch in 'numResults', which must be initialized to * zero by the caller. Returns the final ExecState returned by the cursor in *state. Returns - * whether or not to save the ClientCursor in 'shouldSaveCursor'. Returns the slave's time to - * read until in 'slaveReadTill' (for master/slave). + * whether or not to save the ClientCursor in 'shouldSaveCursor'. * * Returns an OK status if the batch was successfully generated, and a non-OK status if the * PlanExecutor encounters a failure. @@ -173,7 +172,6 @@ void generateBatch(int ntoreturn, ClientCursor* cursor, BufBuilder* bb, int* numResults, - Timestamp* slaveReadTill, PlanExecutor::ExecState* state) { PlanExecutor* exec = cursor->getExecutor(); @@ -191,14 +189,6 @@ void generateBatch(int ntoreturn, // Count the result. (*numResults)++; - - // Possibly note slave's position in the oplog. - if (cursor->queryOptions() & QueryOption_OplogReplay) { - BSONElement e = obj["ts"]; - if (BSONType::Date == e.type() || BSONType::bsonTimestamp == e.type()) { - *slaveReadTill = e.timestamp(); - } - } } // Propagate any errors to the caller. @@ -386,11 +376,6 @@ Message getMore(OperationContext* opCtx, } opCtx->checkForInterrupt(); // May trigger maxTimeAlwaysTimeOut fail point. - cc->updateSlaveLocation(opCtx); - - // If we're replaying the oplog, we save the last time that we read. - Timestamp slaveReadTill; - // What number result are we starting at? Used to fill out the reply. startingResult = cc->pos(); @@ -433,7 +418,7 @@ Message getMore(OperationContext* opCtx, PlanSummaryStats preExecutionStats; Explain::getSummaryStats(*exec, &preExecutionStats); - generateBatch(ntoreturn, cc, &bb, &numResults, &slaveReadTill, &state); + generateBatch(ntoreturn, cc, &bb, &numResults, &state); // If this is an await data cursor, and we hit EOF without generating any results, then // we block waiting for new data to arrive. @@ -458,7 +443,7 @@ Message getMore(OperationContext* opCtx, // We woke up because either the timed_wait expired, or there was more data. Either // way, attempt to generate another batch of results. - generateBatch(ntoreturn, cc, &bb, &numResults, &slaveReadTill, &state); + generateBatch(ntoreturn, cc, &bb, &numResults, &state); } PlanSummaryStats postExecutionStats; @@ -501,11 +486,6 @@ Message getMore(OperationContext* opCtx, LOG(5) << "getMore saving client cursor ended with state " << PlanExecutor::statestr(state); - // Possibly note slave's position in the oplog. - if ((cc->queryOptions() & QueryOption_OplogReplay) && !slaveReadTill.isNull()) { - cc->slaveReadTill(slaveReadTill); - } - *exhaust = cc->queryOptions() & QueryOption_Exhaust; // We assume that cursors created through a DBDirectClient are always used from their @@ -633,9 +613,6 @@ std::string runQuery(OperationContext* opCtx, // How many results have we obtained from the executor? int numResults = 0; - // If we're replaying the oplog, we save the last time that we read. - Timestamp slaveReadTill; - BSONObj obj; PlanExecutor::ExecState state; @@ -658,14 +635,6 @@ std::string runQuery(OperationContext* opCtx, // Count the result. ++numResults; - // Possibly note slave's position in the oplog. - if (qr.isOplogReplay()) { - BSONElement e = obj["ts"]; - if (Date == e.type() || bsonTimestamp == e.type()) { - slaveReadTill = e.timestamp(); - } - } - if (FindCommon::enoughForFirstBatch(qr, numResults)) { LOG(5) << "Enough for first batch, wantMore=" << qr.wantMore() << " ntoreturn=" << qr.getNToReturn().value_or(0) @@ -711,11 +680,6 @@ std::string runQuery(OperationContext* opCtx, << " results"; // TODO document - if (qr.isOplogReplay() && !slaveReadTill.isNull()) { - pinnedCursor.getCursor()->slaveReadTill(slaveReadTill); - } - - // TODO document if (qr.isExhaust()) { curOp.debug().exhaust = true; } |