BugZero found this defect 79 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/11/2024
MongoDB Server
No affected releases provided.
8.0.0-rc0
Problem The jstest fails when Classic multi-planner for SBE is enabled. It fails at the line 240: assertQueryParameterizedCorrectly({ query: {a: {$eq: 1}, b: {$in: maxExplodeIn}}, queryCount: 6, newQuery: {a: {$eq: 2}, b: {$in: maxExplodeIn}}, newQueryCount: 12, reuseEntry: true, }); Reproduce ninja -j128 install-devcore build/install/bin/db_query_test && buildscripts/resmoke.py run --suite core --mongodSetParameters='{logComponentVerbosity: {query: 5}}' --additionalFeatureFlags featureFlagSbeFull,featureFlagClassicRuntimePlanningForSbe jstests/core/query/explode_for_sort_plan_cache.js Investigation The root cause is due to the difference in how keysExamined and numRead tracked in SBE, leading to different criteria for replanning such that Classic decides not to replan whereas SBE decides to replan. 1. Classic only increment keysExamined for examining key. 2. SBE increments numRead for both examining and seeking. Tracing down the callback, it appears that the query is `isExplainAndCacheIneligible() = true`, such that 1. isExplainAndCacheIneligible returns true 2. shouldCacheQuery returns false 3. shouldUpdatePlanCache return false 4. updateSbePlanCacheFromClassicCandidates stops caching the plan. Question 1. It doesn't seem obvious how such query is explain. 2. Why the other queries work as usual? Commenting how this test case in line 240 will make the rest of test pass successfully. 1. Because the number of seeks are small enough for CRP_SBE not to replan in the rest of examples.
xgen-internal-githook commented on Sat, 9 Mar 2024 04:18:50 +0000: Author: {'name': 'Chi-I Huang', 'email': '8468853+chiihuang@users.noreply.github.com', 'username': 'chiihuang'} Message: SERVER-87376 Adjust jstest to minimize seek overhead difference (#19766) GitOrigin-RevId: d49f84a95e67162c0e6fee7976b964b1fd765df1 Branch: master https://github.com/mongodb/mongo/commit/5af73313531e9fc93651e6ade62551f228cadb0e