summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-09-30 11:19:31 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-13 00:32:43 +0000
commitbcab0c7e1c1b2e1516d06d23233fea9a425b99f7 (patch)
tree8d805048d69ece52bb64e740532f5968b671865c /src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
parent0dadef8dd93175bf3a75412d8a32b377d9eba42c (diff)
downloadmongo-bcab0c7e1c1b2e1516d06d23233fea9a425b99f7.tar.gz
SERVER-51200 CollectionPtr in RequiresCollectionStage point to instance owned by AutoGetCollection
RequiresCollectionStage now holds a pointer to CollectionPtr owned by an AutoGetCollection. When we save and restore the executor a new CollectionPtr pointer needs to be assigned. Plan executors can no longer be created with temporary CollectionPtr instances and their interface have been changed to take pointers to avoid binding to rvalues. RequiresCollectionStage no longer loads collections from the catalog and will be in sync with the owning AutoGetCollection.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_check_resume_token_test.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_check_resume_token_test.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp b/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
index 71f01ec190c..fbea1ea1076 100644
--- a/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
+++ b/src/mongo/db/pipeline/document_source_check_resume_token_test.cpp
@@ -159,7 +159,7 @@ private:
class DocumentSourceChangeStreamMock : public DocumentSourceMock {
public:
DocumentSourceChangeStreamMock(const boost::intrusive_ptr<ExpressionContextForTest>& expCtx)
- : DocumentSourceMock({}, expCtx) {
+ : DocumentSourceMock({}, expCtx), _collectionPtr(&_collection) {
_filterExpr = BSON("ns" << kTestNs);
_filter = MatchExpressionParser::parseAndNormalize(_filterExpr, pExpCtx);
_params.assertMinTsHasNotFallenOffOplog = true;
@@ -199,7 +199,7 @@ protected:
// If this is the first call to doGetNext, we must create the COLLSCAN.
if (!_collScan) {
_collScan = std::make_unique<CollectionScan>(
- pExpCtx.get(), &_collection, _params, &_ws, _filter.get());
+ pExpCtx.get(), _collectionPtr, _params, &_ws, _filter.get());
// The first call to doWork will create the cursor and return NEED_TIME. But it won't
// actually scan any of the documents that are present in the mock cursor queue.
ASSERT_EQ(_collScan->doWork(nullptr), PlanStage::NEED_TIME);
@@ -239,6 +239,7 @@ private:
}
ChangeStreamOplogCollectionMock _collection;
+ CollectionPtr _collectionPtr;
std::unique_ptr<CollectionScan> _collScan;
CollectionScanParams _params;