[SERVER-76448] Data race on rename collection participant Created: 24/Apr/23 Updated: 29/Oct/23 Resolved: 26/Apr/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 5.0.0, 6.0.0, 7.0.0-rc0 |
| Fix Version/s: | 7.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Silvia Surroca | Assignee: | Silvia Surroca |
| 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 | ||||||||
| Sprint: | Sharding EMEA 2023-05-01 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 135 | ||||||||
| Description |
|
When shardsvr_rename_collection_participant command is called, first it calls getOrCreate, which returns an instance of a {{renameCollectionParticipant }}running asynchronously, then it checks if the parameters of the request are the same than the parameters of the given instance (to ensure idempotency). Since the check is done while the renameCollectionParticipant is being executed on another thread, there is a data race over _doc attribute:
CONSEQUENCES OF THE BUG: In case of reading a defective _doc value due to a data race the DDL coordinator will retry the command here.
A suggestion to fix this bug is to add a const attribute (which could be called _request) and initiate it on the constructor using the _doc value, similar to what RenameCollectionCoordinator already does (1) (2). |
| Comments |
| Comment by Githook User [ 26/Apr/23 ] |
|
Author: {'name': 'Silvia Surroca', 'email': 'silvia.surroca@mongodb.com', 'username': 'silviasuhu'}Message: |