[SERVER-76368] Allow TransactionRouter on a mongod to early reap retryable sessions Created: 20/Apr/23 Updated: 29/Oct/23 Resolved: 10/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc1 |
| Type: | Task | 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 | ||||||||||||
| Backport Requested: |
v7.0
|
||||||||||||
| Sprint: | Sharding NYC 2023-05-01, Sharding NYC 2023-05-15 | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
Retryable sessions used for retryable transactions have special rules for when they can be reaped from the SessionCatalog. Each session is tied to a txnNumber for some client session and can be reaped once a transaction or retryable write with a higher txnNumber has started on that client session. To remove retryable sessions as soon as possible, they are erased from the SessionCatalog after a new transaction/retryable write starts on a mongos or mongod and the session of the new write is released. This logic does not currently work when a mongod accesses the same retryable session from the router and participant roles (ie TransactionRouter and TransactionParticipant). The participant keeps a map of retryable sessions for the latest transaction, so if the router role tries to clear a retryable session, it may still be in the map, and if the same process accesses that session in the participant role, it may use the freed session and crash. There are very few remote transactions run from a mongod currently, so early reaping was disabled in the router role on a mongod (in |
| Comments |
| Comment by Githook User [ 10/May/23 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: (cherry picked from commit c5bde8dfab169ae2e020eef3e3c1bab8c5f6e841) |
| Comment by Githook User [ 10/May/23 ] |
|
Author: {'name': 'Jack Mulrow', 'email': 'jack.mulrow@mongodb.com', 'username': 'jsmulrow'}Message: |