[SERVER-36799] Move transaction related functionality from Session into TransactionParticipant Created: 21/Aug/18 Updated: 08/Jan/24 Resolved: 08/Oct/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.4 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Siyuan Zhou | Assignee: | Kaloian Manassiev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | ShardedTxn:SessionRefactor | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Sprint: | Sharding 2018-09-24, Sharding 2018-10-08, Sharding 2018-10-22 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
|
| Comments |
| Comment by Githook User [ 08/Oct/18 ] |
|
Author: {'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}Message: This change leaves the Session class to be a plain decorable structure |
| Comment by Githook User [ 12/Sep/18 ] |
|
Author: {'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}Message: |
| Comment by Andy Schwerin [ 24/Aug/18 ] |
|
Just don't name it TransactionManager. I'm already trying to prevent the sharding team from naming a class TransactionCoordinatorManager. |
| Comment by Siyuan Zhou [ 24/Aug/18 ] |
|
As we decided to make Session thin, we can add another indirected layer TransactionManager, which is a decoration on Session and owns TransactionParticipant. TxnNumber is then a member of TransactionManager. There is a one-to-one mapping between the txnNumber to one of the transaction roles: retryable write (no transaction), participant and coordinator. At a given time, the transaction on a session can only be one of the three. A coordinator may owns another participant, but it's different from the one owned by TransactionManager. Bumping txnNumber on TransactionManager will try to abort the current role, which throws an exception if it can't. The benifits are |
| Comment by Esha Maharishi (Inactive) [ 23/Aug/18 ] |
|
Also, if we want to put Session on mongos, Session cannot know about TransactionParticipant. |
| Comment by Andy Schwerin [ 22/Aug/18 ] |
|
There may be another solution by introducing constructor/destructor actions to sessions. I'd really like to avoid direct ownership of TP by Session. |
| Comment by Siyuan Zhou [ 21/Aug/18 ] |
|
renctan, this ticket is from our conversation with mira.carey@mongodb.com, I filed it to make sure we don't forget the problem. |