-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In the old get exec path, we have a check that prohibits forcing a plan solution hash for a rooted $or that's eligible for subplanning: https://github.com/mongodb/mongo/blob/ee45d1d53405686da0356a3a3889d088261c1709/src/mongo/db/query/get_executor.cpp#L405-L409
In the deferred engine selection path, we don't have this check: https://github.com/mongodb/mongo/blob/ee45d1d53405686da0356a3a3889d088261c1709/src/mongo/db/query/get_executor_deferred_engine_choice_planning.cpp#L307-L309
This was caught when I was disabling CBR. There is a test jstests/core/query/force_plan.js which doesn't run if CBR is enabled. But if its disabled, the test runs and expects that we error with IllegalOperation in this case. So when I disabled CBR, this test failed under the query_get_exec_deferred_engine_choice_jscore_passthrough suite because we got a different error (NoQueryExecutionPlans). I think the fix is just adding the same uassert in the deferred engine selection path.