[SERVER-59516] Create opCtx outside of lock in oplog fetcher Created: 23/Aug/21 Updated: 29/Oct/23 Resolved: 24/Aug/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.0.3, 5.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Xuerui Fa | Assignee: | Xuerui Fa |
| 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: |
v5.0
|
||||||||
| Participants: | |||||||||
| Linked BF Score: | 156 | ||||||||
| Description |
|
In the OplogFetcher, we should create the opCtx before we obtain the lock here. Since destructors are called in reverse order, the current code tries to destruct the opCtx when it goes out of scope before releasing the lock. This leads to a potential deadlock situation with tenant migrations. |
| Comments |
| Comment by Vivian Ge (Inactive) [ 06/Oct/21 ] |
|
Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you! |
| Comment by Githook User [ 27/Aug/21 ] |
|
Author: {'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'}Message: (cherry picked from commit 8c345c6693b6b60947f5134cb76efdf4500258dd) |
| Comment by Daniel Gottlieb (Inactive) [ 25/Aug/21 ] |
xuerui.fa Can you expand some on this? I imagine this means that destructing an OperationContext can acquire* resources? If that's so, can you point me to the code that does that? |
| Comment by Githook User [ 24/Aug/21 ] |
|
Author: {'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'}Message: |