[SERVER-62185] Ensure TenantMigrationRecipentService Fetcher instance survives future completion Created: 20/Dec/21 Updated: 29/Oct/23 Resolved: 23/Dec/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.0 |
| 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: | 131 | ||||||||||||
| Description |
|
The TenantMigrationRecipientService creates a Fetcher to retrieve files from the backup cursor used in the shard merge protocol. During shutdown of the PrimaryOnlyService, which means the captured shared pointer to the fetcher will also be destroyed, resulting in the destruction of the fetcher itself. This can result in deadlock during destruction when Fetcher::shutdown is called and tries to acquire the Fetcher mutex, which is already held by a previous Fetcher callback. The solution here is to ensure that the Fetcher instance survives future completion by making the Fetcher a std::unique_ptr member of the TenantMigrationRecipientService class. |
| Comments |
| Comment by Githook User [ 22/Dec/21 ] |
|
Author: {'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}Message: |