[SERVER-36485] ‘killSessions’ (for one session) and 'endSessions' should return a “PreparedTransactionInProgress” error if it tries to kill a session that has a prepared transaction in it Created: 07/Aug/18 Updated: 29/Oct/23 Resolved: 16/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.7 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Misha Tyulenev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | prepare_errors | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||
| Sprint: | Repl 2018-08-27, Sharding 2019-01-28 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Comments |
| Comment by Githook User [ 16/Jan/19 ] |
|
Author: {'username': 'mikety', 'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev'}Message: |
| Comment by Judah Schvimer [ 02/Jan/19 ] |
|
This SGTM, if kaloian.manassiev agrees that doing nothing is acceptable (though maybe not ideal), then we'll de-prioritize this towards the end of the project. We definitely should at least test that prepared transactions cannot be killed with killSessions as part of this ticket. |
| Comment by Tess Avitabile (Inactive) [ 17/Dec/18 ] |
|
SGTM. I think we could also do nothing, since abortArbitraryTransaction() does not abort prepared transactions. But if it's helpful to avoid killing the operation context, then we can make that change. |
| Comment by Kaloian Manassiev [ 17/Dec/18 ] |
|
OK great, in that case for this ticket we should implement the solution in (2) above: add a check here that the transaction is not prepared, so that the operation context of any prepared transactions does not get interrupted accidentally, like we do with the expired transactions. |
| Comment by Tess Avitabile (Inactive) [ 17/Dec/18 ] |
|
Re (2): I think it is acceptable for killSessions to silently ignore sessions with prepared transactions. Re (3): We are no longer planning to abort all transactions on FCV downgrade, so that call to killSessionsLocalKillTransactions will be removed. We have work planned to block FCV downgrade until there are no more prepared transactions: |
| Comment by Kaloian Manassiev [ 14/Dec/18 ] |
|
The endSessions command is asynchronous and as such there is no way to return any value from it. Regardless of this though, if there is a prepared transaction on such a session, the session will not be ended regardless until the transaction commits, so this should not be a problem. For killSession - it uses the SessionsKiller, which kills sessions in batches. Its return value doesn't convey anything about the individual sessions that were attempted to be killed and on top of that it can also aggregate killing sessions from different calls, so it is hard to pass any success or failure information back. I have a couple of questions:
|