[SERVER-62377] withTxnAndAutoRetry() must retry commitTransaction command on FailedToSatisfyReadPreference error response Created: 05/Jan/22  Updated: 06/May/22  Resolved: 31/Jan/22

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.3.2, 5.0.9

Type: Task Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Andrew Witten (Inactive)
Resolution: Done Votes: 0
Labels: sharding-nyc-subteam2, sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
causes SERVER-65633 withTxnAndAutoRetry() retries entire ... Closed
Related
is related to SERVER-60706 Retry FailedToSatisfyReadPreference e... Backlog
Backport Requested:
v5.3, v5.2, v5.0
Participants:
Linked BF Score: 25
Story Points: 3

 Description   

Some test suite configurations use withTxnAndAutoRetry() to automatically retry running a JavaScript function within a multi-statement transaction until it succeeds. However, the commitTransaction command may fail with a FailedToSatisfyReadPreference if there isn't a primary on the coordinator shard for kDefaultFindHostTimeout (15 seconds). This leads shouldRetryEntireTxnOnError() to end up failing with an uncaught JavaScript exception.

We can probably add another case like this one in shouldRetryWithNetworkErrorOverride() to retry the commitTransaction on a FailedToSatisfyReadPreference error response.



 Comments   
Comment by Githook User [ 28/Jan/22 ]

Author:

{'name': 'Andrew Witten', 'email': 'andrew.witten@mongodb.com', 'username': 'awitten1'}

Message: SERVER-62377 retry txn on FailedToSatisfyReadPreference in jstest
Branch: master
https://github.com/mongodb/mongo/commit/50caf49d16f8245856211db493d983acc864fa6d

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