summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/catalog/collection_info_cache.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/catalog/collection_info_cache.cpp b/src/mongo/db/catalog/collection_info_cache.cpp
index 1fe87f116aa..9682ee40899 100644
--- a/src/mongo/db/catalog/collection_info_cache.cpp
+++ b/src/mongo/db/catalog/collection_info_cache.cpp
@@ -119,10 +119,10 @@ void CollectionInfoCache::notifyOfQuery(OperationContext* txn,
const std::set<std::string>& indexesUsed) {
// Record indexes used to fulfill query.
for (auto it = indexesUsed.begin(); it != indexesUsed.end(); ++it) {
- if (NULL == _collection->getIndexCatalog()->findIndexByName(txn, *it)) {
- // Index removed since the operation started. Nothing to report.
- continue;
- }
+ // This index should still exist, since the PlanExecutor would have been killed if the
+ // index was dropped (and we would not get here).
+ dassert(NULL != _collection->getIndexCatalog()->findIndexByName(txn, *it));
+
_indexUsageTracker.recordIndexAccess(*it);
}
}