Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65460

Make validation that queries which allow disk use are prohibited in read-only mode work correctly

    • Minor Change
    • v6.0
    • QE 2022-04-18, QE 2022-05-02, QE 2022-05-16

      Prior to MongoDB 6.0, allowDiskUse for queries was false by default. Individual queries could explicitly override this default by passing allowDiskUse:true. If a mongod is started in read-only mode via the --queryableBackupMode parameter, then queries which are allowed to spill to disk are prohibited. This was implemented a bit oddly, since in read-only mode we currently we ban any query that explicitly includes an allowDiskUse parameter, whether or not the value of the parameter is true or false.

      In 6.0, we are changing the default to true, so that spilling to disk is allowed by default. Individual queries may override this default by specifying allowDiskUse:false. We are also introducing a new allowDiskUseByDefault parameter which can be used to configure the default disk use behavior on a per-node basis.

      If we do nothing regarding read-only mode, then we will continue to just ban queries which explicitly pass the allowDiskUse option, regardless of the values of either allowDiskUse or allowDiskUseByDefault. This is not fully correct. The work for this ticket is to change the behavior to ban any query which is allowed to spill in read-only mode. This should be the case if either 1) the query explicitly specified allowDiskUse:true, or 2) the query did not specify allowDiskUse but allowDiskUseByDefault is true. Furthermore, the validation should apply to find, aggregate, mapReduce, count against a view, and distinct against a view.

            Assignee:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: