diff options
author | David Storch <david.storch@mongodb.com> | 2022-04-20 16:31:53 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-04-20 17:44:11 +0000 |
commit | 717d8209e0cc15f9a86b4ddd2700e1ad3bab2c0a (patch) | |
tree | c31a973e76c4d098027d16e74afbd2db46b0810e /src | |
parent | 42a0da5e29268a786cf9f4eb109492f7364d8090 (diff) | |
download | mongo-717d8209e0cc15f9a86b4ddd2700e1ad3bab2c0a.tar.gz |
SERVER-65477 Allow plan_cache_replanning.js to run with the SBE plan cache enabled
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/query/sbe_cached_solution_planner.cpp | 8 |
1 files changed, 8 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 ace203172f3..8aa5c2105a0 100644 --- a/src/mongo/db/query/sbe_cached_solution_planner.cpp +++ b/src/mongo/db/query/sbe_cached_solution_planner.cpp @@ -174,8 +174,16 @@ CandidatePlans CachedSolutionPlanner::replan(bool shouldCache, std::string reaso if (shouldCache) { const auto& mainColl = _collections.getMainCollection(); // Deactivate the current cache entry. + // + // TODO SERVER-64882: We currently deactivate cache entries in both the classic and SBE plan + // caches. Once we always use the SBE plan cache for queries eligible for SBE, this code can + // be simplified to only deactivate the entry in the SBE plan cache. auto cache = CollectionQueryInfo::get(mainColl).getPlanCache(); cache->deactivate(plan_cache_key_factory::make<mongo::PlanCacheKey>(_cq, mainColl)); + if (feature_flags::gFeatureFlagSbePlanCache.isEnabledAndIgnoreFCV()) { + auto&& sbePlanCache = sbe::getPlanCache(_opCtx); + sbePlanCache.deactivate(plan_cache_key_factory::make<sbe::PlanCacheKey>(_cq, mainColl)); + } } auto buildExecutableTree = [&](const QuerySolution& sol) { |