Investigate changes in SERVER-127688: Reject queries that will perform a full COLLSCAN on a large collection

XMLWordPrintableJSON

    • Type: Investigation
    • Resolution: Done
    • Priority: Major - P3
    • 100.18.0
    • Affects Version/s: None
    • Component/s: None
    • Tools and Replicator
    • 0.5

      Original Downstream Change Summary

      This change adds a new mongod query-planning knob, maxEstimatedScanBytes, configurable at startup or runtime via setParameter, which rejects queries that would require an unbounded, unlimited COLLSCAN on collections whose logical data size exceeds the configured threshold. It also adds new serverStatus / FTDC metrics under serverStatus.metrics.query.maxEstimatedScanBytes for rejected queries and $natural-overridden queries. Downstream attention is needed from Cloud, Mongotune, Triage & Release, and Docs because this introduces a new configuration option and new serverStatus metrics.

      Description of Linked Ticket

      Create a server parameter that provides more fine-grained control than notablescan. Limit collection scans and full index scans to some constant. At planning time we can use the collection size to estimate this limit. In the presence of multi-key indexes we would not get a strict limit, but that's OK for the first implementation.

      Note that this kind of reverts some of what was done in SPM-1024. However, the goal here is something more intelligent than maxScan and different than maxTimeMS – we want to reject queries before starting their execution (like notablescan).

      Any attempt to do this should start by reviewing the findings of WRITING-33020.

            Assignee:
            Matthew Brazel
            Reporter:
            Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: