summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog/type_collection.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-10-25 12:55:37 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2016-10-27 16:03:23 -0400
commite8cbb32624663fdf59f6df752594e5295c55247c (patch)
treea2fa9e520e29f3d58149472a98cf23e467a4476b /src/mongo/s/catalog/type_collection.cpp
parent604cf316385ddb9e6bc0361d0bb300024b4bc98c (diff)
downloadmongo-e8cbb32624663fdf59f6df752594e5295c55247c.tar.gz
SERVER-26777 Improve logging around chunk refresh
Unifies the logging messages between mongos and mongod and adds timing information.
Diffstat (limited to 'src/mongo/s/catalog/type_collection.cpp')
-rw-r--r--src/mongo/s/catalog/type_collection.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/s/catalog/type_collection.cpp b/src/mongo/s/catalog/type_collection.cpp
index 5c94eb3fc69..aed93093462 100644
--- a/src/mongo/s/catalog/type_collection.cpp
+++ b/src/mongo/s/catalog/type_collection.cpp
@@ -105,8 +105,15 @@ StatusWith<CollectionType> CollectionType::fromBSON(const BSONObj& source) {
}
coll._keyPattern = KeyPattern(obj.getOwned());
- } else if ((status == ErrorCodes::NoSuchKey) && coll.getDropped()) {
- // Sharding key can be missing if the collection is dropped
+ } else if (status == ErrorCodes::NoSuchKey) {
+ // Sharding key can only be missing if the collection is dropped
+ if (!coll.getDropped()) {
+ return {status.code(),
+ str::stream() << "Shard key for collection " << coll._fullNs->ns()
+ << " is missing, but the collection is not marked as "
+ "dropped. This is an indication of corrupted sharding "
+ "metadata."};
+ }
} else {
return status;
}