diff options
author | jannaerin <golden.janna@gmail.com> | 2018-07-11 17:13:27 -0400 |
---|---|---|
committer | jannaerin <golden.janna@gmail.com> | 2018-08-20 12:02:46 -0400 |
commit | 6f7c674d0a247b230dd11b3184d9f52524dd18cc (patch) | |
tree | b4c7d85124f180b0122b1f48dc37395ff48dcb9e | |
parent | 71d9adab875205ce5cbc1d026de1cf359c77f7ce (diff) | |
download | mongo-6f7c674d0a247b230dd11b3184d9f52524dd18cc.tar.gz |
SERVER-36071 Check status of shardsvrShardCollection
(cherry picked from commit a291ec89affd9e849ac62ad55a736bfb940a0bb6)
-rw-r--r-- | src/mongo/db/s/config/configsvr_shard_collection_command.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp index d16a4d23b8a..03d62642551 100644 --- a/src/mongo/db/s/config/configsvr_shard_collection_command.cpp +++ b/src/mongo/db/s/config/configsvr_shard_collection_command.cpp @@ -780,10 +780,18 @@ public: cmdObj, shardsvrShardCollectionRequest.toBSON())), Shard::RetryPolicy::kIdempotent)); - CommandHelpers::filterCommandReplyForPassthrough(cmdResponse.response, &result); + // SERVER-14394 Remove status check below and replace with + // filterCommandReplyForPassthrough + uassertStatusOK(cmdResponse.commandStatus); auto shardCollResponse = ShardsvrShardCollectionResponse::parse( IDLParserErrorContext("ShardsvrShardCollectionResponse"), cmdResponse.response); + auto uuid = std::move(shardCollResponse.getCollectionUUID()); + + result << "collectionsharded" << nss.ns(); + if (uuid) { + result << "collectionUUID" << *uuid; + } // Make sure the cached metadata for the collection knows that we are now sharded catalogCache->invalidateShardedCollection(nss); |