[SERVER-62797] Invalidate SBE plan cache when any of the query knobs is changed Created: 20/Jan/22  Updated: 29/Oct/23  Resolved: 23/Feb/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc0

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

Issue Links:
Depends
Related
related to SERVER-61421 Refine plan cache key filter componen... Closed
related to SERVER-63885 Flush new optimizer's plan cache when... Closed
Backwards Compatibility: Fully Compatible
Sprint: QE 2022-02-21, QE 2022-03-07
Participants:
Linked BF Score: 35

 Description   

Some query knobs may change the semantics of generated plans that are stored in the cache. One way to deal with it would be to encode the values of such query knobs into the plan cache key and only invalidate the cache when any of these knobs is changed. This could be error prone if a new query knob is added in the future but a plan cache key encoding scheme is not updated.

A safer approach would be to invalidate the cache when any of the query knobs is changed. Given that it's a relatively rare operation, it shouldn't cause too much operational disruption. With this approach all query knobs will have to have an on_update hook to flush the cache.



 Comments   
Comment by Githook User [ 24/Feb/22 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-62797 Fix tests which expect disabling SBE to keep the plan cache intact
Branch: master
https://github.com/mongodb/mongo/commit/ead3b8d93e73f879a8f6d8087c7b527a57594003

Comment by Githook User [ 23/Feb/22 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-62797 Clear SBE plan cache when query knobs are changed

This necessary for any parameters which could affect the
plans which are generated and cached by the optimizer. This
commit also updates the encoding of the SBE plan cache key
so that it no longer encodes the values of these parameters.
Branch: master
https://github.com/mongodb/mongo/commit/149e5e01ecadaf3361d31e7ac850977b66db0751

Generated at Thu Feb 08 05:56:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.