summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornatalie.tsvetkova <natalie.tsvetkova@mongodb.com>2018-10-15 15:57:47 -0400
committerjannaerin <golden.janna@gmail.com>2019-05-07 11:20:33 -0400
commit85d79aa9b83eaef8a6287382df89668aa59f1023 (patch)
tree3ad918e308b600426006afc123efc0a8a94c2cbd
parent9cc66cf86b7d6a2e60e0045b047e3dbd6d53d493 (diff)
downloadmongo-85d79aa9b83eaef8a6287382df89668aa59f1023.tar.gz
SERVER-36355: Improve error message when shard key not present in all documents
(cherry picked from commit 9e71e5092e987354516f443db9d3f557f3ebf574)
-rw-r--r--src/mongo/db/s/check_sharding_index_command.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/db/s/check_sharding_index_command.cpp b/src/mongo/db/s/check_sharding_index_command.cpp
index 6df603e8709..7c4d2e19b65 100644
--- a/src/mongo/db/s/check_sharding_index_command.cpp
+++ b/src/mongo/db/s/check_sharding_index_command.cpp
@@ -192,8 +192,9 @@ public:
continue;
const string msg = str::stream()
- << "found missing value in key " << redact(currKey)
- << " for doc: " << (obj.hasField("_id") ? redact(obj) : redact(obj["_id"]));
+ << "There are documents which have missing or incomplete shard key fields ("
+ << redact(currKey) << "). Please ensure that all documents in the collection "
+ "include all fields from the shard key.";
log() << "checkShardingIndex for '" << nss.toString() << "' failed: " << msg;
errmsg = msg;