diff options
author | Alex Taskov <alex.taskov@mongodb.com> | 2020-09-16 15:01:53 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-16 23:40:59 +0000 |
commit | 99c10e35e5e1afdacb9919be2e9f5f596da56a21 (patch) | |
tree | ffeddb1771f3eb756ececd0d2b69d9966febe5d1 /src/mongo/db/s/op_observer_sharding_impl.cpp | |
parent | 805fbca1f08295451080f8d845699a00fff88d9a (diff) | |
download | mongo-99c10e35e5e1afdacb9919be2e9f5f596da56a21.tar.gz |
SERVER-49821 Define utility function for getting recipient which would own document under new shard key
Diffstat (limited to 'src/mongo/db/s/op_observer_sharding_impl.cpp')
-rw-r--r-- | src/mongo/db/s/op_observer_sharding_impl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/s/op_observer_sharding_impl.cpp b/src/mongo/db/s/op_observer_sharding_impl.cpp index 60e93d7f0a2..60f809ba791 100644 --- a/src/mongo/db/s/op_observer_sharding_impl.cpp +++ b/src/mongo/db/s/op_observer_sharding_impl.cpp @@ -34,11 +34,13 @@ #include "mongo/db/s/op_observer_sharding_impl.h" #include "mongo/db/catalog_raii.h" +#include "mongo/db/repl/oplog_entry.h" #include "mongo/db/s/active_move_primaries_registry.h" #include "mongo/db/s/collection_sharding_runtime.h" #include "mongo/db/s/database_sharding_state.h" #include "mongo/db/s/migration_chunk_cloner_source_legacy.h" #include "mongo/db/s/migration_source_manager.h" +#include "mongo/db/s/resharding_util.h" #include "mongo/logv2/log.h" namespace mongo { @@ -214,4 +216,11 @@ void OpObserverShardingImpl::shardObserveTransactionPrepareOrUnpreparedCommit( opCtx->getServiceContext(), stmts, prepareOrCommitOptime)); } +void OpObserverShardingImpl::shardAnnotateOplogEntry(OperationContext* opCtx, + const NamespaceString nss, + const BSONObj& doc, + repl::ReplOperation& op) { + op.setDestinedRecipient(getDestinedRecipient(opCtx, nss, doc)); +} + } // namespace mongo |