[SERVER-84369] Ineligible query reuses plan cache entry for a COUNT_SCAN (SBE only) Created: 21/Dec/23 Updated: 11/Jan/24 Resolved: 09/Jan/24 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.2.1, 7.3.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Alya Berciu | Assignee: | Ruoxin Xu |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Operating System: | ALL | ||||||||||||
| Backport Requested: |
v7.2, v7.1
|
||||||||||||
| Sprint: | QO 2023-12-25, QO 2024-01-08, QO 2024-01-22 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 135 | ||||||||||||
| Description |
|
See BF-31072 for a detailed description/repro of the problem. The following pipeline (A) is ineligible for a COUNT_SCAN:
However, when this pipeline (B) runs first:
B uses a COUNT_SCAN, and generates a plan-cache entry, which A then (incorrectly) uses. Both queries should match/count an empty document {}; however, B does not count it when using a COUNT_SCAN. This is only reproducible with SBE enabled, plan cache on, and match expression optimization enabled. |
| Comments |
| Comment by Githook User [ 11/Jan/24 ] |
|
Author: {'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}Message: (cherry picked from commit 99853e7a9c71d793b5b3c5028e322bf0215d2697) |
| Comment by Githook User [ 09/Jan/24 ] |
|
Author: {'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}Message: GitOrigin-RevId: 99853e7a9c71d793b5b3c5028e322bf0215d2697 |