[SERVER-64456] Use countDocuments() instead of count() to ensure accurate document count Created: 11/Mar/22 Updated: 29/Oct/23 Resolved: 14/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Christopher Caplinger | Assignee: | Christopher Caplinger |
| 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 | ||||
| Participants: | |||||
| Linked BF Score: | 15 | ||||
| Description |
|
Use "countDocuments" instead of "count" to ensure that we get an accurate count instead of an approximate count from metadata. Otherwise, the count can be inaccurate if a TTL pass happens concurrently with the count call when the access blocker is blocking writes. In this case, the TTL delete will fail and be rolled back, but count calls before the rollback is applied will still reflect the delete. |
| Comments |
| Comment by Githook User [ 14/Mar/22 ] |
|
Author: {'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}Message: |