We have a try-catch around computing the query shape for the querySettings key, but it only catches BSONObjectTooLarge errors. We should catch more errors so that a failure to compute the querySettings key does not fail the whole query. We could do something similar to this try-catch on the $queryStats path where we only fail the query on debug builds. In most cases, we should simply skip trying to use querySettings and proceed with query typical planning/execution.
This kind of change would help avoid issues like HELP-63821 where the query succeeds in parsing but fails in computing the query shape so that the query does not execute.
SERVER-94231 is tackling the same for queryStats.
- is related to
-
SERVER-94227 Stop validating pipelines if re-parsing for query stats, plus a refactor
- Blocked
-
SERVER-94231 Query should not fail if queryStats fails to compute key
- Closed