[SERVER-37235] invalidateSessions calls inside the OpObserver should be registered in the RecoveryUnit onCommit callback Created: 20/Sep/18  Updated: 29/Oct/23  Resolved: 14/May/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.1.3
Fix Version/s: 4.1.12

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: prepare_errors
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-36493 Invalidate in-memory prepared transac... Closed
is related to SERVER-38576 Ban direct writes to transaction tabl... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2019-01-28, Sharding 2019-02-11, Sharding 2019-02-25, Sharding 2019-03-11, Sharding 2019-03-25, Sharding 2019-04-08, Sharding 2019-04-22, Sharding 2019-05-06, Sharding 2019-05-20
Participants:

 Description   

otherwise, it is possible for another thread trying to perform a refresh as a response to being invalidated will not see the side effect that cause the invalidation.



 Comments   
Comment by Githook User [ 14/May/19 ]

Author:

{'name': 'Gregory Wlodarek', 'username': 'GWlodarek', 'email': 'gregory.wlodarek@mongodb.com'}

Message: SERVER-37235 Adding missing header file
Branch: master
https://github.com/mongodb/mongo/commit/02f1d3c5196953588c7a2d3e9aa0114eb7e1c643

Comment by Githook User [ 14/May/19 ]

Author:

{'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}

Message: SERVER-37235 Use an onCommit/Abort handler to complete session kill on direct writes to `config.transactions`
Branch: master
https://github.com/mongodb/mongo/commit/3cbd136094249209a212aab06696c2ef0db41b26

Comment by Kaloian Manassiev [ 15/Jan/19 ]

The purpose of calling invalidateSessions directly in the OpObserver is so that it has a chance to "veto" the direct write if for example there is a prepared transaction on it. With the session check-out mechanism now in place, refresh can only be called by a thread which has the session checked-out and since invalidateSessions kills the session and then checks it out in order to invalidate it.

Because of this, the only thing which needs to be registered in on-commit handler is the actual call to invalidate, but not the kill.

Generated at Thu Feb 08 04:45:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.