summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2016-11-15 09:57:53 -0500
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2016-11-15 09:57:53 -0500
commit57ed82f0692bfb4e7a045a0108d029e53b21e3f8 (patch)
tree6dbcbe35ea010fad07b554115fb89876f04e9946 /src/mongo/db/dbhelpers.cpp
parent1ebe71d22dfa865fd451909a666305f581302f5c (diff)
downloadmongo-57ed82f0692bfb4e7a045a0108d029e53b21e3f8.tar.gz
SERVER-24994 Check in Helpers::removeRange() if shard key index dropped.
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r--src/mongo/db/dbhelpers.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index 4b441b90bd3..daf2767c908 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -365,6 +365,12 @@ long long Helpers::removeRange(OperationContext* txn,
IndexDescriptor* desc = collection->getIndexCatalog()->findIndexByName(txn, indexName);
+ if (!desc) {
+ warning(LogComponent::kSharding) << "shard key index '" << indexName << "' on '"
+ << ns << "' was dropped";
+ return -1;
+ }
+
unique_ptr<PlanExecutor> exec(
InternalPlanner::indexScan(txn,
collection,