diff options
author | David Storch <david.storch@mongodb.com> | 2021-05-13 20:07:46 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-17 13:59:21 +0000 |
commit | 66a536d56c7146547d30a965f0ecb35d611a9a42 (patch) | |
tree | 674e00914468cd55d772a83a1116a6c107881ccb /src/mongo/db/query/sbe_cached_solution_planner.cpp | |
parent | 77c25b4ef2c573287a66a206214c875274ae09ba (diff) | |
download | mongo-66a536d56c7146547d30a965f0ecb35d611a9a42.tar.gz |
SERVER-56792 Fail query in SBE cached planner and subplanner if an index is dropped during yield
Diffstat (limited to 'src/mongo/db/query/sbe_cached_solution_planner.cpp')
-rw-r--r-- | src/mongo/db/query/sbe_cached_solution_planner.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/query/sbe_cached_solution_planner.cpp b/src/mongo/db/query/sbe_cached_solution_planner.cpp index 01bc55c9653..f6838f2b28d 100644 --- a/src/mongo/db/query/sbe_cached_solution_planner.cpp +++ b/src/mongo/db/query/sbe_cached_solution_planner.cpp @@ -117,6 +117,11 @@ CandidatePlans CachedSolutionPlanner::replan(bool shouldCache, std::string reaso // yield policy. _yieldPolicy->clearRegisteredPlans(); + // We're planning from scratch, using the original set of indexes provided in '_queryParams'. + // Therefore, if any of the collection's indexes have been dropped, the query should fail with + // a 'QueryPlanKilled' error. + _indexExistenceChecker.check(); + if (shouldCache) { // Deactivate the current cache entry. auto cache = CollectionQueryInfo::get(_collection).getPlanCache(); |