summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/text_or.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2018-11-16 18:06:14 -0500
committerDavid Storch <david.storch@10gen.com>2018-11-27 17:12:22 -0500
commit6efa4ed0820b6f6e3a2615dc5f42e13ce3415ad8 (patch)
tree464a742478e5f3119632114cca1d8508b63bb576 /src/mongo/db/exec/text_or.cpp
parentf588dad3e3b16a9e717cf457485dad3e7f45ae1d (diff)
downloadmongo-6efa4ed0820b6f6e3a2615dc5f42e13ce3415ad8.tar.gz
SERVER-37448 Make remaining PlanStages check catalog validity on restore.
Handles COUNT_SCAN, DISTINCT_SCAN, IDHACK, and TEXT_OR.
Diffstat (limited to 'src/mongo/db/exec/text_or.cpp')
-rw-r--r--src/mongo/db/exec/text_or.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mongo/db/exec/text_or.cpp b/src/mongo/db/exec/text_or.cpp
index 04b754621bd..55cdf0a747b 100644
--- a/src/mongo/db/exec/text_or.cpp
+++ b/src/mongo/db/exec/text_or.cpp
@@ -59,16 +59,13 @@ TextOrStage::TextOrStage(OperationContext* opCtx,
const FTSSpec& ftsSpec,
WorkingSet* ws,
const MatchExpression* filter,
- IndexDescriptor* index)
- : PlanStage(kStageType, opCtx),
+ const Collection* collection)
+ : RequiresCollectionStage(kStageType, opCtx, collection),
_ftsSpec(ftsSpec),
_ws(ws),
_scoreIterator(_scores.end()),
_filter(filter),
- _idRetrying(WorkingSet::INVALID_ID),
- _index(index) {}
-
-TextOrStage::~TextOrStage() {}
+ _idRetrying(WorkingSet::INVALID_ID) {}
void TextOrStage::addChild(unique_ptr<PlanStage> child) {
_children.push_back(std::move(child));
@@ -84,13 +81,13 @@ bool TextOrStage::isEOF() {
return _internalState == State::kDone;
}
-void TextOrStage::doSaveState() {
+void TextOrStage::doSaveStateRequiresCollection() {
if (_recordCursor) {
_recordCursor->saveUnpositioned();
}
}
-void TextOrStage::doRestoreState() {
+void TextOrStage::doRestoreStateRequiresCollection() {
if (_recordCursor) {
invariant(_recordCursor->restore());
}
@@ -158,7 +155,7 @@ PlanStage::StageState TextOrStage::doWork(WorkingSetID* out) {
PlanStage::StageState TextOrStage::initStage(WorkingSetID* out) {
*out = WorkingSet::INVALID_ID;
try {
- _recordCursor = _index->getCollection()->getCursor(getOpCtx());
+ _recordCursor = collection()->getCursor(getOpCtx());
_internalState = State::kReadingTerms;
return PlanStage::NEED_TIME;
} catch (const WriteConflictException&) {