diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2022-01-16 09:00:03 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-16 08:55:41 +0000 |
commit | b2915693899db7af9e22346504a10157857f55c8 (patch) | |
tree | c98e7f87556d377f761561690bae61e8d27a1b3f /src/mongo/db/pipeline | |
parent | e60858dc5165457c7c5f8574af8d2dead06143d0 (diff) | |
download | mongo-b2915693899db7af9e22346504a10157857f55c8.tar.gz |
Revert "SERVER-62239 Put tenantId on opCtx if passed as $tenant"
Revert "SERVER-61986 Add TenantNamespace to Collection object"
This reverts commit da6685f2648051ce806ad700d31787a1f365cfdc.
This reverts commit 560cf02296f03685faaaf5f655dec00316dbbd85.
Diffstat (limited to 'src/mongo/db/pipeline')
-rw-r--r-- | src/mongo/db/pipeline/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/pipeline/document_source_change_stream_test.cpp | 43 | ||||
-rw-r--r-- | src/mongo/db/pipeline/document_source_check_resume_token_test.cpp | 3 |
3 files changed, 15 insertions, 32 deletions
diff --git a/src/mongo/db/pipeline/SConscript b/src/mongo/db/pipeline/SConscript index fd3b9ecbb49..097f55717b6 100644 --- a/src/mongo/db/pipeline/SConscript +++ b/src/mongo/db/pipeline/SConscript @@ -400,7 +400,6 @@ env.Library( 'document_source_change_stream_unwind_transaction.cpp', ], LIBDEPS=[ - '$BUILD_DIR/mongo/db/multitenancy', '$BUILD_DIR/mongo/db/ops/write_ops_parsers', '$BUILD_DIR/mongo/db/pipeline/pipeline', '$BUILD_DIR/mongo/db/pipeline/sharded_agg_helpers', diff --git a/src/mongo/db/pipeline/document_source_change_stream_test.cpp b/src/mongo/db/pipeline/document_source_change_stream_test.cpp index d088415968a..c2cbe9ea701 100644 --- a/src/mongo/db/pipeline/document_source_change_stream_test.cpp +++ b/src/mongo/db/pipeline/document_source_change_stream_test.cpp @@ -65,7 +65,6 @@ #include "mongo/db/repl/replication_coordinator_mock.h" #include "mongo/db/s/resharding/resharding_change_event_o2_field_gen.h" #include "mongo/db/s/resharding_util.h" -#include "mongo/db/tenant_namespace.h" #include "mongo/db/transaction_history_iterator.h" #include "mongo/idl/server_parameter_test_util.h" #include "mongo/unittest/death_test.h" @@ -573,8 +572,7 @@ TEST_F(ChangeStreamStageTest, ShouldRejectBothStartAtOperationTimeAndResumeAfter auto expCtx = getExpCtx(); // Need to put the collection in the collection catalog so the resume token is valid. - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(expCtx->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(expCtx->opCtx, testUuid(), std::move(collection)); }); @@ -596,8 +594,7 @@ TEST_F(ChangeStreamStageTest, ShouldRejectBothStartAfterAndResumeAfterOptions) { auto opCtx = expCtx->opCtx; // Need to put the collection in the collection catalog so the resume token is validcollection - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(opCtx, testUuid(), std::move(collection)); }); @@ -620,8 +617,7 @@ TEST_F(ChangeStreamStageTest, ShouldRejectBothStartAtOperationTimeAndStartAfterO auto opCtx = expCtx->opCtx; // Need to put the collection in the collection catalog so the resume token is valid. - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(opCtx, testUuid(), std::move(collection)); }); @@ -643,8 +639,7 @@ TEST_F(ChangeStreamStageTest, ShouldRejectResumeAfterWithResumeTokenMissingUUID) auto opCtx = expCtx->opCtx; // Need to put the collection in the collection catalog so the resume token is valid. - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(opCtx, testUuid(), std::move(collection)); }); @@ -2381,8 +2376,7 @@ TEST_F(ChangeStreamStageTest, DocumentKeyShouldIncludeShardKeyFromResumeToken) { const auto opTime = repl::OpTime(ts, term); const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -2430,8 +2424,7 @@ TEST_F(ChangeStreamStageTest, DocumentKeyShouldNotIncludeShardKeyFieldsIfNotPres const auto opTime = repl::OpTime(ts, term); const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -2475,8 +2468,7 @@ TEST_F(ChangeStreamStageTest, ResumeAfterFailsIfResumeTokenDoesNotContainUUID) { const Timestamp ts(3, 45); const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -2531,8 +2523,7 @@ TEST_F(ChangeStreamStageTest, ResumeAfterWithTokenFromInvalidateShouldFail) { auto expCtx = getExpCtx(); // Need to put the collection in the collection catalog so the resume token is valid. - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(expCtx->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, testUuid(), std::move(collection)); }); @@ -3202,8 +3193,7 @@ TEST_F(ChangeStreamStageDBTest, DocumentKeyShouldIncludeShardKeyFromResumeToken) const auto opTime = repl::OpTime(ts, term); const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -3241,8 +3231,7 @@ TEST_F(ChangeStreamStageDBTest, DocumentKeyShouldNotIncludeShardKeyFieldsIfNotPr const auto opTime = repl::OpTime(ts, term); const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -3281,8 +3270,7 @@ TEST_F(ChangeStreamStageDBTest, DocumentKeyShouldNotIncludeShardKeyIfResumeToken const auto opTime = repl::OpTime(ts, term); const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -3320,8 +3308,7 @@ TEST_F(ChangeStreamStageDBTest, ResumeAfterWithTokenFromInvalidateShouldFail) { auto expCtx = getExpCtx(); // Need to put the collection in the collection catalog so the resume token is valid. - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(expCtx->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, testUuid(), std::move(collection)); }); @@ -3344,8 +3331,7 @@ TEST_F(ChangeStreamStageDBTest, ResumeAfterWithTokenFromInvalidateShouldFail) { TEST_F(ChangeStreamStageDBTest, ResumeAfterWithTokenFromDropDatabase) { const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); @@ -3376,8 +3362,7 @@ TEST_F(ChangeStreamStageDBTest, ResumeAfterWithTokenFromDropDatabase) { TEST_F(ChangeStreamStageDBTest, StartAfterSucceedsEvenIfResumeTokenDoesNotContainUUID) { const auto uuid = testUuid(); - std::shared_ptr<Collection> collection = - std::make_shared<CollectionMock>(TenantNamespace(boost::none, nss)); + std::shared_ptr<Collection> collection = std::make_shared<CollectionMock>(nss); CollectionCatalog::write(getExpCtx()->opCtx, [&](CollectionCatalog& catalog) { catalog.registerCollection(getExpCtx()->opCtx, uuid, std::move(collection)); }); 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 66b0b6c62c1..d8de83dee59 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 @@ -95,8 +95,7 @@ private: class ChangeStreamOplogCollectionMock : public CollectionMock { public: - ChangeStreamOplogCollectionMock() - : CollectionMock(TenantNamespace(boost::none, NamespaceString::kRsOplogNamespace)) { + ChangeStreamOplogCollectionMock() : CollectionMock(NamespaceString::kRsOplogNamespace) { _recordStore = _devNullEngine.getRecordStore(nullptr, NamespaceString::kRsOplogNamespace.ns(), "", {}); } |