diff options
author | Robert Guo <robert.guo@10gen.com> | 2015-11-20 17:07:33 -0500 |
---|---|---|
committer | Robert Guo <robert.guo@10gen.com> | 2015-11-30 17:15:52 -0500 |
commit | 609fb074f87cc47971f0ae85a6e4eb571b67c129 (patch) | |
tree | 9ea26f8b6cec4b34b6773c8606e2cfdc256c23c5 | |
parent | 293c4435cb1a1897012206c66c15b34b6e99c542 (diff) | |
download | mongo-609fb074f87cc47971f0ae85a6e4eb571b67c129.tar.gz |
SERVER-21596 Check if output collection is sharded when doing mapReduce
-rw-r--r-- | src/mongo/s/commands/cluster_map_reduce_cmd.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp index 42272057bb9..ec4d6a4fef6 100644 --- a/src/mongo/s/commands/cluster_map_reduce_cmd.cpp +++ b/src/mongo/s/commands/cluster_map_reduce_cmd.cpp @@ -514,6 +514,12 @@ public: // Do the splitting round ChunkManagerPtr cm = confOut->getChunkManagerIfExists(txn, finalColLong); + + uassert(34359, + str::stream() << "Failed to write mapreduce output to " << finalColLong + << "; expected that collection to be sharded, but it was not", + cm); + for (const auto& chunkSize : chunkSizes) { BSONObj key = chunkSize.first; const int size = chunkSize.second; |