[SERVER-36565] Killing a session with a transaction can cause the thread to throw WriteConflictError Created: 09/Aug/18 Updated: 29/Oct/23 Resolved: 13/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.3, 4.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Janna Golden | Assignee: | Janna Golden |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.0
|
||||||||
| Sprint: | Sharding 2018-08-27 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 45 | ||||||||
| Description |
|
When killSessions is called on a session running a transaction, the transaction is aborted. The command that’s running can return a WriteConflict error that is not labeled with `TransientTransactionError` if the transaction is aborted while a write command is running, causing the thread to throw down the line. I’ve reproduced this with an `update` command in the concurrency suite - if there is a writeConflict caught here, we then check if we’re in a transaction in `handleError()` here . We don’t check if we’ve aborted a transaction though, so we would not throw here in this case, and instead would return the error and not catch the it in writeCommands::run() as we should be doing. We can also hit the invariant here for the same reason (if the transaction was aborted slightly earlier). We should check if the transaction was aborted and should also look into if the other places we call `inMultiDocumenTransaction()` need to be changed as well. |
| Comments |
| Comment by Githook User [ 28/Aug/18 ] |
|
Author: {'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}Message: (cherry picked from commit d3941824b4473898bf987c7db381a84879d33c27) |
| Comment by Githook User [ 13/Aug/18 ] |
|
Author: {'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}Message: |