diff options
author | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-11-15 09:57:53 -0500 |
---|---|---|
committer | Max Hirschhorn <max.hirschhorn@mongodb.com> | 2016-11-15 09:57:53 -0500 |
commit | 57ed82f0692bfb4e7a045a0108d029e53b21e3f8 (patch) | |
tree | 6dbcbe35ea010fad07b554115fb89876f04e9946 /src/mongo/db/dbhelpers.cpp | |
parent | 1ebe71d22dfa865fd451909a666305f581302f5c (diff) | |
download | mongo-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.cpp | 6 |
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, |