[SERVER-26413] Hinting an incompatible partial index can return incomplete results Created: 30/Sep/16 Updated: 13/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 3.2.4, 3.3.8 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Chris Harris | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | query-44-grooming, quick-wins-candidates, tech-debt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Steps To Reproduce: |
|
||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||
| Description |
|
The database currently allows for partial indexes to be hinted regardless of the filters applied to the query. When these filters do not align with the partialFilterExpression for an index, there may be documents that match the query but are not included in the index. Forcing index usage via a hint in such a scenario will lead to the database returning incomplete results (a silent logical failure). Returning an error is probably the most correct thing to do. Alternatively, the hint could be rejected and the standard plan generation process could be observed. |
| Comments |
| Comment by Ralf Strobel [ 26/Jul/23 ] |
|
Just for the record, this is still present in MongoDB 6.0 and just took two of our developers over a day to figure out what was happening. Would it really be so difficult to return an error when an inappropriate index is being forced accidentally? |