[SERVER-65460] Make validation that queries which allow disk use are prohibited in read-only mode work correctly Created: 11/Apr/22  Updated: 29/Oct/23  Resolved: 05/May/22

Status: Closed
Project: Core Server
Component/s: Query Execution
Affects Version/s: None
Fix Version/s: 6.0.0-rc5, 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Romans Kasperovics
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Minor Change
Backport Requested:
v6.0
Sprint: QE 2022-04-18, QE 2022-05-02, QE 2022-05-16
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 05/May/22 ]

Author:

{'name': 'Romans Kasperovics', 'email': 'romans.kasperovics@mongodb.com', 'username': 'romanskas'}

Message: SERVER-65460 Set allowDiskUse to false in read-only mode
Branch: v6.0
https://github.com/mongodb/mongo/commit/a70e930841581a660fb9be8a1f28f4ef4e58bb91

Comment by David Storch [ 13/Apr/22 ]

Requested backport to 6.0.

Generated at Thu Feb 08 06:02:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.