-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
ALL
-
-
QE 2024-12-23
-
0
Currently if we try to explain an SBE plan with huge slots value.
For example, db.coll.find({a: {$in: 16 MB of strings} with an index on
will an array of index bounds that will take ~32 MB (because every strings in $in will generate left and right ends of an interval).
And in explain output they will be added to BSONObjBuilder as a single string:
https://github.com/mongodb/mongo/blob/17b674eac96c953bd40d3c42854c82a4e8668d50/src/mongo/db/query/plan_explainer_sbe.h#L88
This maybe considered reasonable behavior, because such query is unreasonable,
However, it may hinder some error handling and hide errors.
For example, here we try to get basic explain data for an error log and it will throw an error instead of an actual error. And this can happen in execution, not explain:
https://github.com/mongodb/mongo/blob/17b674eac96c953bd40d3c42854c82a4e8668d50/src/mongo/db/commands/query_cmd/run_aggregate.cpp#L394
It may even happen when aggregation throws a retryable error like "QueryPlanKilled" due to collection drop and it will change into a non-retryable one.
- is related to
-
SERVER-60052 Truncate SBE explain plan stats if they exceed max BSON depth
- Closed