diff options
author | Haley Connelly <haley.connelly@mongodb.com> | 2021-06-15 19:51:38 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-17 17:50:30 +0000 |
commit | c865688f1993bba72cbffc39d5e80f21313ba4ee (patch) | |
tree | 1158aadcf8212a30f1c3791e0918dd744640f6ca /src | |
parent | 9b3de8ee95340dedf91e47d1e81e327c2875cc7b (diff) | |
download | mongo-c865688f1993bba72cbffc39d5e80f21313ba4ee.tar.gz |
SERVER-57478 Remove code related to local.system.resharding.slimOplogForGraphLookup view
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/mongod_main.cpp | 1 | ||||
-rw-r--r-- | src/mongo/db/namespace_string.cpp | 3 | ||||
-rw-r--r-- | src/mongo/db/namespace_string.h | 3 | ||||
-rw-r--r-- | src/mongo/db/repl/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/db/s/resharding/resharding_agg_test.cpp | 5 | ||||
-rw-r--r-- | src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp | 2 | ||||
-rw-r--r-- | src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/s/resharding_util.cpp | 52 | ||||
-rw-r--r-- | src/mongo/db/s/resharding_util.h | 8 |
9 files changed, 0 insertions, 81 deletions
diff --git a/src/mongo/db/mongod_main.cpp b/src/mongo/db/mongod_main.cpp index c14577624c5..2fd444f818a 100644 --- a/src/mongo/db/mongod_main.cpp +++ b/src/mongo/db/mongod_main.cpp @@ -714,7 +714,6 @@ ExitCode _initAndListen(ServiceContext* serviceContext, int listenPort) { if (replSettings.usingReplSets()) { Lock::GlobalWrite lk(startupOpCtx.get()); OldClientContext ctx(startupOpCtx.get(), NamespaceString::kRsOplogNamespace.ns()); - createSlimOplogView(startupOpCtx.get(), ctx.db()); tenant_migration_util::createOplogViewForTenantMigrations(startupOpCtx.get(), ctx.db()); } } diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index 1ad9bdb94c3..6e0868f31c4 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -121,9 +121,6 @@ const NamespaceString NamespaceString::kReshardingApplierProgressNamespace( const NamespaceString NamespaceString::kReshardingTxnClonerProgressNamespace( NamespaceString::kConfigDb, "localReshardingOperations.recipient.progress_txn_cloner"); -const NamespaceString NamespaceString::kReshardingOplogView( - NamespaceString::kLocalDb, "system.resharding.slimOplogForGraphLookup"); - const NamespaceString NamespaceString::kCollectionCriticalSectionsNamespace( NamespaceString::kConfigDb, "collection_critical_sections"); diff --git a/src/mongo/db/namespace_string.h b/src/mongo/db/namespace_string.h index c4748a3be11..b5420e4c6a6 100644 --- a/src/mongo/db/namespace_string.h +++ b/src/mongo/db/namespace_string.h @@ -172,9 +172,6 @@ public: // Namespace for storing config.transactions cloner progress for resharding. static const NamespaceString kReshardingTxnClonerProgressNamespace; - // Namespace for view on local.oplog.rs for resharding. - static const NamespaceString kReshardingOplogView; - // Namespace for storing config.collectionCriticalSections documents static const NamespaceString kCollectionCriticalSectionsNamespace; diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index eb8ce074e9e..5d29cb4e258 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -49,7 +49,6 @@ env.Library( '$BUILD_DIR/mongo/db/dbdirectclient', '$BUILD_DIR/mongo/db/dbhelpers', '$BUILD_DIR/mongo/db/op_observer', - '$BUILD_DIR/mongo/db/s/resharding_util', '$BUILD_DIR/mongo/db/stats/counters', '$BUILD_DIR/mongo/db/stats/server_read_concern_write_concern_metrics', '$BUILD_DIR/mongo/db/transaction', diff --git a/src/mongo/db/s/resharding/resharding_agg_test.cpp b/src/mongo/db/s/resharding/resharding_agg_test.cpp index b4f62996041..58fb77a7cb6 100644 --- a/src/mongo/db/s/resharding/resharding_agg_test.cpp +++ b/src/mongo/db/s/resharding/resharding_agg_test.cpp @@ -187,15 +187,10 @@ protected: } boost::intrusive_ptr<ExpressionContextForTest> createExpressionContext() { - NamespaceString slimNss = - NamespaceString("local.system.resharding.slimOplogForGraphLookup"); - boost::intrusive_ptr<ExpressionContextForTest> expCtx( new ExpressionContextForTest(getOpCtx(), _localOplogBufferNss)); expCtx->setResolvedNamespace(_localOplogBufferNss, {_localOplogBufferNss, {}}); expCtx->setResolvedNamespace(_remoteOplogNss, {_remoteOplogNss, {}}); - expCtx->setResolvedNamespace(slimNss, - {slimNss, std::vector<BSONObj>{getSlimOplogPipeline()}}); return expCtx; } diff --git a/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp b/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp index 9f3f6d7a3a6..434e5c9d0a0 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_fetcher.cpp @@ -57,8 +57,6 @@ namespace mongo { namespace { boost::intrusive_ptr<ExpressionContext> _makeExpressionContext(OperationContext* opCtx) { StringMap<ExpressionContext::ResolvedNamespace> resolvedNamespaces; - const NamespaceString slimOplogNs("local.system.resharding.slimOplogForGraphLookup"); - resolvedNamespaces[slimOplogNs.coll()] = {slimOplogNs, std::vector<BSONObj>()}; resolvedNamespaces[NamespaceString::kRsOplogNamespace.coll()] = { NamespaceString::kRsOplogNamespace, std::vector<BSONObj>()}; return make_intrusive<ExpressionContext>(opCtx, diff --git a/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp b/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp index 958ac588789..40ce2dcf21e 100644 --- a/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp +++ b/src/mongo/db/s/resharding/resharding_oplog_fetcher_test.cpp @@ -93,7 +93,6 @@ public: { Lock::GlobalWrite lk(_opCtx); OldClientContext ctx(_opCtx, NamespaceString::kRsOplogNamespace.ns()); - createSlimOplogView(_opCtx, ctx.db()); } // Initialize ReshardingMetrics to a recipient state compatible with fetching. @@ -189,15 +188,10 @@ public: } boost::intrusive_ptr<ExpressionContextForTest> createExpressionContext() { - NamespaceString slimNss = - NamespaceString("local.system.resharding.slimOplogForGraphLookup"); - boost::intrusive_ptr<ExpressionContextForTest> expCtx( new ExpressionContextForTest(_opCtx, NamespaceString::kRsOplogNamespace)); expCtx->setResolvedNamespace(NamespaceString::kRsOplogNamespace, {NamespaceString::kRsOplogNamespace, {}}); - expCtx->setResolvedNamespace(slimNss, - {slimNss, std::vector<BSONObj>{getSlimOplogPipeline()}}); return expCtx; } diff --git a/src/mongo/db/s/resharding_util.cpp b/src/mongo/db/s/resharding_util.cpp index 03c6a96dd35..5856e4c1f0f 100644 --- a/src/mongo/db/s/resharding_util.cpp +++ b/src/mongo/db/s/resharding_util.cpp @@ -250,58 +250,6 @@ std::vector<BSONObj> buildTagsDocsFromZones(const NamespaceString& tempNss, return tags; } -void createSlimOplogView(OperationContext* opCtx, Database* db) { - writeConflictRetry( - opCtx, "createReshardingSlimOplog", NamespaceString::kReshardingOplogView.ns(), [&] { - { - // Create 'system.views' in a separate WUOW if it does not exist. - WriteUnitOfWork wuow(opCtx); - CollectionPtr coll = CollectionCatalog::get(opCtx)->lookupCollectionByNamespace( - opCtx, NamespaceString(db->getSystemViewsName())); - if (!coll) { - coll = db->createCollection(opCtx, NamespaceString(db->getSystemViewsName())); - } - invariant(coll); - wuow.commit(); - } - - // Resharding uses the `prevOpTime` to link oplog related entries via a - // $graphLookup. Large transactions and prepared transaction use prevOpTime to identify - // earlier oplog entries from the same transaction. Retryable writes (identified via the - // presence of `stmtId`) use prevOpTime to identify earlier run statements from the same - // retryable write. This view will unlink oplog entries from the same retryable write - // by zeroing out their `prevOpTime`. - CollectionOptions options; - options.viewOn = NamespaceString::kRsOplogNamespace.coll().toString(); - options.pipeline = BSON_ARRAY(getSlimOplogPipeline()); - WriteUnitOfWork wuow(opCtx); - auto status = db->createView(opCtx, NamespaceString::kReshardingOplogView, options); - if (status == ErrorCodes::NamespaceExists) { - return; - } - uassertStatusOK(status); - wuow.commit(); - }); -} - -BSONObj getSlimOplogPipeline() { - return fromjson( - "{$project: {\ - _id: '$ts',\ - op: 1,\ - o: {\ - applyOps: {ui: 1, destinedRecipient: 1},\ - abortTransaction: 1\ - },\ - ts: 1,\ - 'prevOpTime.ts': {$cond: {\ - if: {$eq: [{$type: '$stmtId'}, 'missing']},\ - then: '$prevOpTime.ts',\ - else: Timestamp(0, 0)\ - }}\ - }}"); -} - std::unique_ptr<Pipeline, PipelineDeleter> createOplogFetchingPipelineForResharding( const boost::intrusive_ptr<ExpressionContext>& expCtx, const ReshardingDonorOplogId& startAfter, diff --git a/src/mongo/db/s/resharding_util.h b/src/mongo/db/s/resharding_util.h index c01888ddee6..48a626272b4 100644 --- a/src/mongo/db/s/resharding_util.h +++ b/src/mongo/db/s/resharding_util.h @@ -270,14 +270,6 @@ std::vector<BSONObj> buildTagsDocsFromZones(const NamespaceString& tempNss, const std::vector<ReshardingZoneType>& zones); /** - * Creates a view on the oplog that facilitates the specialized oplog tailing a resharding - * recipient performs on a donor. - */ -void createSlimOplogView(OperationContext* opCtx, Database* db); - -BSONObj getSlimOplogPipeline(); - -/** * Creates a pipeline that can be serialized into a query for fetching oplog entries. `startAfter` * may be `Timestamp::isNull()` to fetch from the beginning of the oplog. */ |