-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Background
maxEstimatedScanBytes rejects queries at plan time when the plan requires an unbounded COLLSCAN on a collection whose data size exceeds a configured byte threshold. Query Settings (PQS) can override this threshold per query shape via queryKnobs.maxEstimatedScanBytes. Existing coverage in jstests/noPassthrough/query/max_estimated_scan_bytes.js tests that PQS can lower or raise the threshold for a specific shape, but there was no coverage confirming that setting the PQS override to -1 (the "disabled" sentinel) fully exempts that shape from rejection while leaving other shapes subject to the global threshold.
Task
Add a test case to jstests/noPassthrough/query/max_estimated_scan_bytes.js that:
- Sets the global maxEstimatedScanBytes server parameter to a low value that would reject an unbounded scan on a heavy collection.
- Applies a PQS {{queryKnobs:
{maxEstimatedScanBytes: -1}
}} override for one query shape.
- Verifies the targeted shape now succeeds (exempted from rejection).
- Verifies a differently-shaped query is still rejected by the global threshold, confirming the override is scoped to the specific query shape only.
A candidate implementation has already been written as test "PQS queryKnobs maxEstimatedScanBytes: -1 exempts a specific query shape" in jstests/noPassthrough/query/max_estimated_scan_bytes.js, placed alongside the existing "PQS queryKnobs can lower/raise maxEstimatedScanBytes" tests. Verified locally: all 34 test cases in the file pass with this addition (via buildscripts/resmoke.py run --suites=no_passthrough jstests/noPassthrough/query/max_estimated_scan_bytes.js).