[SERVER-71106] Access to Grid members should be protected with isShardingInitialized Created: 04/Nov/22 Updated: 29/Oct/23 Resolved: 23/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Randolph Tan | Assignee: | Randolph Tan |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Sharding NYC
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Sprint: | Sharding NYC 2023-03-20, Sharding NYC 2023-04-03, Sharding NYC 2023-04-17, Sharding NYC 2023-05-01 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||
| Story Points: | 2 | ||||||||||||||||
| Description |
|
Access to Grid members should be protected with isShardingInitialized when it can be called in both sharded and non-sharded context. This is because there is race that happens when addShard is performed, the mongod transitions from being non-sharded to sharded and calls Grid::init, which races with all other places where Grid can be accessed even in non-sharded context. Some examples include: https://github.com/mongodb/mongo/blob/cb138e05cf54d14fa886995c329c8da2c235d74b/src/mongo/db/exec/update_stage.cpp#L758 |
| Comments |
| Comment by Githook User [ 23/May/23 ] |
|
Author: {'name': 'Randolph Tan', 'email': 'randolph@10gen.com', 'username': 'renctan'}Message: |
| Comment by Randolph Tan [ 31/Mar/23 ] |
|
Removing from the PM-2290 epic as I confused ShardingState enabled with Grid::init. |
| Comment by Randolph Tan [ 04/Nov/22 ] |
|
Note that this is not the first time we encountered this in the code base ( |