summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/op_observer_sharding_impl.cpp
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2021-02-22 22:40:23 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-22 21:35:26 +0000
commitf25c2c9cfbb0e4ae20cd080b3b79a505308db175 (patch)
treec7ea4b97d7d09961438f57c746bcf8922738dc0a /src/mongo/db/s/op_observer_sharding_impl.cpp
parent2e11c995441e7490a9da9891ff6acc6f84a8163b (diff)
downloadmongo-f25c2c9cfbb0e4ae20cd080b3b79a505308db175.tar.gz
SERVER-53679 No-op for filling in destined recipient for insert oplog entries adds overhead on shardsvrs not running resharding
Diffstat (limited to 'src/mongo/db/s/op_observer_sharding_impl.cpp')
-rw-r--r--src/mongo/db/s/op_observer_sharding_impl.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mongo/db/s/op_observer_sharding_impl.cpp b/src/mongo/db/s/op_observer_sharding_impl.cpp
index e28211edef6..27581a81578 100644
--- a/src/mongo/db/s/op_observer_sharding_impl.cpp
+++ b/src/mongo/db/s/op_observer_sharding_impl.cpp
@@ -124,12 +124,13 @@ void OpObserverShardingImpl::shardObserveInsertOp(OperationContext* opCtx,
const NamespaceString nss,
const BSONObj& insertedDoc,
const repl::OpTime& opTime,
+ CollectionShardingState* css,
const bool fromMigrate,
const bool inMultiDocumentTransaction) {
if (nss == NamespaceString::kSessionTransactionsTableNamespace || fromMigrate)
return;
- auto* const csr = CollectionShardingRuntime::get(opCtx, nss);
+ auto* const csr = CollectionShardingRuntime::get(css);
csr->checkShardVersionOrThrow(opCtx);
auto metadata = csr->getCurrentMetadataIfKnown();
@@ -155,9 +156,10 @@ void OpObserverShardingImpl::shardObserveUpdateOp(OperationContext* opCtx,
boost::optional<BSONObj> preImageDoc,
const BSONObj& postImageDoc,
const repl::OpTime& opTime,
+ CollectionShardingState* css,
const repl::OpTime& prePostImageOpTime,
const bool inMultiDocumentTransaction) {
- auto* const csr = CollectionShardingRuntime::get(opCtx, nss);
+ auto* const csr = CollectionShardingRuntime::get(css);
csr->checkShardVersionOrThrow(opCtx);
auto metadata = csr->getCurrentMetadataIfKnown();
@@ -182,9 +184,10 @@ void OpObserverShardingImpl::shardObserveDeleteOp(OperationContext* opCtx,
const NamespaceString nss,
const BSONObj& documentKey,
const repl::OpTime& opTime,
+ CollectionShardingState* css,
const repl::OpTime& preImageOpTime,
const bool inMultiDocumentTransaction) {
- auto* const csr = CollectionShardingRuntime::get(opCtx, nss);
+ auto* const csr = CollectionShardingRuntime::get(css);
csr->checkShardVersionOrThrow(opCtx);
auto metadata = csr->getCurrentMetadataIfKnown();
@@ -219,8 +222,10 @@ void OpObserverShardingImpl::shardObserveTransactionPrepareOrUnpreparedCommit(
void OpObserverShardingImpl::shardAnnotateOplogEntry(OperationContext* opCtx,
const NamespaceString nss,
const BSONObj& doc,
- repl::DurableReplOperation& op) {
- op.setDestinedRecipient(getDestinedRecipient(opCtx, nss, doc));
+ repl::DurableReplOperation& op,
+ CollectionShardingState* css,
+ const ScopedCollectionDescription& collDesc) {
+ op.setDestinedRecipient(getDestinedRecipient(opCtx, nss, doc, css, collDesc));
}
} // namespace mongo