summaryrefslogtreecommitdiff
path: root/src/mongo/s
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2018-08-21 10:50:04 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2019-02-27 10:51:15 -0500
commitb049257fbd1d215388cffaf7544f6741dbce5b45 (patch)
tree90e385d3c5af33c64f2dc8b590447c606c58f611 /src/mongo/s
parent6df5463e57c068a653f27fa44daaa619453d602f (diff)
downloadmongo-b049257fbd1d215388cffaf7544f6741dbce5b45.tar.gz
SERVER-39495 Move ShardingState::needCollectionMetadata under OperationShardingState
ShardingState logically contains answers to questions about whether the current instance is node in a sharded cluster, whereas OperationShardingState is responsible for the 'shardedness' of the commands.
Diffstat (limited to 'src/mongo/s')
-rw-r--r--src/mongo/s/commands/commands_public.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mongo/s/commands/commands_public.cpp b/src/mongo/s/commands/commands_public.cpp
index 2e4dfba1970..1f89e4e3f59 100644
--- a/src/mongo/s/commands/commands_public.cpp
+++ b/src/mongo/s/commands/commands_public.cpp
@@ -265,6 +265,9 @@ public:
const NamespaceString nss(parseNs(dbName, cmdObj));
const auto routingInfo =
uassertStatusOK(Grid::get(opCtx)->catalogCache()->getCollectionRoutingInfo(opCtx, nss));
+ uassert(ErrorCodes::IllegalOperation,
+ "You can't convertToCapped a sharded collection",
+ !routingInfo.cm());
// convertToCapped creates a temp collection and renames it at the end. It will require
// special handling for create collection.