[SERVER-60286] Global IS lock needed to read from CollectionCatalog in appendCollectionStorageStats Created: 28/Sep/21 Updated: 06/Oct/21 Resolved: 06/Oct/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Henrik Edin | Assignee: | Rui Liu |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | QE 2021-10-18 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 145 | ||||||||||||
| Description |
|
appendCollectionStorageStats reads from the CollectionCatalog without holding any locks: This is not safe as there can be a writer with the global lock in exclusive mode modifying the CollectionCatalog in place. See: https://github.com/mongodb/mongo/blob/625072e57daff2a654df209b55602a2eba8054b2/src/mongo/db/catalog/collection_catalog.h#L126-L131 |
| Comments |
| Comment by Rui Liu [ 06/Oct/21 ] |
|
This can be closed as the need of taking the lock has been reverted. https://jira.mongodb.org/browse/SERVER-58736?focusedCommentId=4104121&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-4104121 |