summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
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 e0d6da23040..d3c62ea0ef8 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -351,6 +351,12 @@ long long Helpers::removeRange(OperationContext* txn,
IndexDescriptor* desc =
collection->getIndexCatalog()->findIndexByKeyPattern(txn, indexKeyPattern.toBSON());
+ if (!desc) {
+ warning(LogComponent::kSharding) << "shard key index " << indexKeyPattern.toBSON()
+ << " on '" << ns << "' was dropped";
+ return -1;
+ }
+
unique_ptr<PlanExecutor> exec(
InternalPlanner::indexScan(txn,
collection,