[SERVER-66090] Make mongod service entry point resilient to session yielding Created: 29/Apr/22 Updated: 29/Oct/23 Resolved: 04/May/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.0.0-rc5, 6.1.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jack Mulrow | Assignee: | Jack Mulrow |
| 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: |
v6.0
|
||||
| Sprint: | Sharding 2022-05-02, Sharding NYC 2022-05-16 | ||||
| Participants: | |||||
| Description |
|
The mongod service entry point will stash a TransactionParticipant::Participant (effectively a pointer to the transaction state that decorates a Session from the SessionCatalog) and on command errors use it to clean up the transaction. If during the command the Session associated with that participant is yielded and the command is interrupted, the clean up code may run without the session checked out, so it's unsafe to access the participant. This is an existing issue, but before PM-2210, very few operations yielded a session (only certain aggregation stages in a transaction and the logic that waits for an ongoing prepared transaction to complete before starting a transaction with a higher txnNumber). Instead, the clean up code should get the participant via TransactionParticipant::get() to ensure the session is still checked out. |
| Comments |
| Comment by Githook User [ 04/May/22 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: (cherry picked from commit e63da638a19323b426ef39e819eda14109ef9746) |
| Comment by Githook User [ 04/May/22 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: |