diff options
author | Jordi Serra Torrens <jordi.serra-torrens@mongodb.com> | 2021-12-28 08:13:09 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-12-29 11:01:33 +0000 |
commit | 1e5c94ab5444a6301974c5a2c4dda9b8ae325168 (patch) | |
tree | 16724f9c1d29d7907260df3541855173e65bc75d /src | |
parent | c38b7077536cd1e039c9ca72eaf5f4183b3a9b8e (diff) | |
download | mongo-1e5c94ab5444a6301974c5a2c4dda9b8ae325168.tar.gz |
SERVER-62207 Make ReshardCollectionCoordinator store an owned BSON object for the command
(cherry picked from commit 5eab3ca8acaa0e8004c50112187b6809667157a2)
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/s/reshard_collection_coordinator.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/s/reshard_collection_coordinator.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/s/reshard_collection_coordinator.cpp b/src/mongo/db/s/reshard_collection_coordinator.cpp index 452f17fdaf6..76d75706614 100644 --- a/src/mongo/db/s/reshard_collection_coordinator.cpp +++ b/src/mongo/db/s/reshard_collection_coordinator.cpp @@ -43,7 +43,9 @@ ReshardCollectionCoordinator::ReshardCollectionCoordinator( OperationContext* opCtx, const ShardsvrReshardCollection& reshardCollectionParams) : ShardingDDLCoordinator_NORESILIENT(opCtx, reshardCollectionParams.getCommandParameter()), _serviceContext(opCtx->getServiceContext()), - _request(reshardCollectionParams), + _requestObj(reshardCollectionParams.serialize({})), + _request(ShardsvrReshardCollection::parse(IDLParserErrorContext("_shardsvrReshardCollection"), + _requestObj)), _nss(_request.getCommandParameter()) {} SemiFuture<void> ReshardCollectionCoordinator::runImpl( diff --git a/src/mongo/db/s/reshard_collection_coordinator.h b/src/mongo/db/s/reshard_collection_coordinator.h index 5ab6cd58704..56b6e5d0430 100644 --- a/src/mongo/db/s/reshard_collection_coordinator.h +++ b/src/mongo/db/s/reshard_collection_coordinator.h @@ -45,6 +45,8 @@ private: SemiFuture<void> runImpl(std::shared_ptr<executor::TaskExecutor> executor) override; ServiceContext* _serviceContext; + const OpMsgRequest _requestObj; // Owned object to guarantee the lifetime of the objects + // referenced by the parsed request '_request' const ShardsvrReshardCollection _request; const NamespaceString& _nss; }; |