[SERVER-40792] Error details won't exist if transient transaction error is thrown when handling WouldChangeOwningShard error Created: 23/Apr/19  Updated: 29/Oct/23  Resolved: 08/May/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Bug Priority: Major - P3
Reporter: Blake Oler Assignee: Blake Oler
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2019-04-22, Sharding 2019-05-06, Sharding 2019-05-20
Participants:

 Description   

When handling a WouldChangeOwningShard error for a retryable write, we make a call to the ClusterWriter. In the case that we receive a transient transaction error, we bypass filling the BatchedCommandResponse object and its writeErrorDetails variable.

Error handling in the WouldChangeOwningShard path assumes that the writeErrorDetails variable will be filled. But in this case, it will be a null pointer and will cause a segmentation fault. We should instead check if _writeErrorDetails exists, and if not, create it before populating the variable with the error status.



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

Author:

{'name': 'Blake Oler', 'username': 'BlakeIsBlake', 'email': 'blake.oler@mongodb.com'}

Message: SERVER-40792 Create error details if doesn't already exist when handling WouldChangeOwningShard error
Branch: master
https://github.com/mongodb/mongo/commit/f25d7d70ca9b2c0282640779adf5c690c0368f1b

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