[SERVER-81398] Make analyzeShardKey and query sampling take locks when looking up collection UUID Created: 24/Sep/23 Updated: 29/Oct/23 Resolved: 27/Sep/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.2.0-rc0, 7.0.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Cheahuychou Mao | Assignee: | Cheahuychou Mao |
| 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.1, v7.0
|
||||||||
| Sprint: | Sharding NYC 2023-10-02 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 2 | ||||||||
| Description |
|
The code for analyzeShardKey and query sampling currently looks up the uuid for a collection by doing lookupUUIDByNSS() (e.g. here and here) which based on the documentation doesn't require holding locks. However, as described in SERVER-81182 and BF-29025, looking up the uuid this way isn't safe against rollback and shutdown. The code should be changed to use the shard_role helper acquireCollectionMaybeLockFree like suggested by the storage execution team. |
| Comments |
| Comment by Githook User [ 10/Oct/23 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}Message: (cherry picked from commit ece3037193bb341eb9adbbaa84c69ddbf5ed74b4) |
| Comment by Githook User [ 27/Sep/23 ] |
|
Author: {'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}Message: |