[SERVER-73307] Make `CurOpStack` always store a pointer to its `OpCtx` Created: 25/Jan/23 Updated: 29/Oct/23 Resolved: 17/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Amirsaman Memaripour | Assignee: | Patrick Freed |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Assigned Teams: |
Service Arch
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | Service Arch 2023-02-06, Service Arch 2023-02-20 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 155 | ||||||||||||
| Description |
|
At the time of writing this ticket, CurOp is defined as a decoration on OperationContext, through CurOpStack which may contain a stack of CurOp objects:
CurOpStack holds a pointer to OperationContext, however, this pointer is not initialized until after the first CurOp is pushed to the stack:
We can use constructor actions (similar to the following example) to initialize the _opCtx member on CurOpStack during the construction of OperationContext, making sure _opCtx is always initialized and obviating the need to provide opCtx as an argument to CurOpStack and CurOp member functions. This also helps with simplifying the changes introduced by
|
| Comments |
| Comment by Githook User [ 17/Feb/23 ] | |||
|
Author: {'name': 'Patrick Freed', 'email': 'patrick.freed@mongodb.com', 'username': 'patrickfreed'}Message: This also ensures base lock stats are properly subtracted out when getting the lock stats for a given sub operation (fixes | |||
| Comment by Githook User [ 15/Feb/23 ] | |||
|
Author: {'name': 'liubov.molchanova', 'email': 'liubov.molchanova@mongodb.com', 'username': 'liubov-molchanova'}Message: Revert " This reverts commit ff7fcd42e84317e2a34e0b413ee4cc1d9be66884. | |||
| Comment by Githook User [ 15/Feb/23 ] | |||
|
Author: {'name': 'Patrick Freed', 'email': 'patrick.freed@mongodb.com', 'username': 'patrickfreed'}Message: This also ensures base lock stats are properly subtracted out when getting the lock stats for a given sub operation (fixes | |||
| Comment by Amirsaman Memaripour [ 26/Jan/23 ] | |||
|
Another approach to get the opCtx pointer is through the owner interface:
|