summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlake Oler <blake.oler@mongodb.com>2019-09-09 15:37:57 +0000
committerBlake Oler <blake.oler@mongodb.com>2020-01-16 11:55:52 -0500
commit6874650b362138df74be53d366bbefc321ea32d4 (patch)
tree98ce14d3d4545d1453827b5578b9e84e9d5ed1bb /src
parentfd6c988c65319c4a57acf3764536657ae13b3113 (diff)
downloadmongo-9d9d6deaffb44a5c7f6aeee88dcea8753c9efe94.tar.gz
SERVER-43195 Add namespace to ChunkManager ShardKeyNotFound errors in order to better diagnose failuresr4.2.3-rc1r4.2.3
(cherry picked from commit 20761c26375cd0febaade9d93af5b8848845bef9)
Diffstat (limited to 'src')
-rw-r--r--src/mongo/s/chunk_manager.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/s/chunk_manager.cpp b/src/mongo/s/chunk_manager.cpp
index c1012cfb0f5..e7ea2996dd9 100644
--- a/src/mongo/s/chunk_manager.cpp
+++ b/src/mongo/s/chunk_manager.cpp
@@ -95,14 +95,15 @@ Chunk ChunkManager::findIntersectingChunk(const BSONObj& shardKey, const BSONObj
for (BSONElement elt : shardKey) {
uassert(ErrorCodes::ShardKeyNotFound,
str::stream() << "Cannot target single shard due to collation of key "
- << elt.fieldNameStringData(),
+ << elt.fieldNameStringData() << " for namespace " << getns(),
!CollationIndexKey::isCollatableType(elt.type()));
}
}
const auto it = _rt->getChunkMap().upper_bound(_rt->_extractKeyString(shardKey));
uassert(ErrorCodes::ShardKeyNotFound,
- str::stream() << "Cannot target single shard using key " << shardKey,
+ str::stream() << "Cannot target single shard using key " << shardKey
+ << " for namespace " << getns(),
it != _rt->getChunkMap().end() && it->second->containsKey(shardKey));
return Chunk(*(it->second), _clusterTime);