[SERVER-57051] Shard may fail to notify that router was stale for command in multi-statement transaction Created: 19/May/21  Updated: 29/Oct/23  Resolved: 25/May/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 5.0.0
Fix Version/s: 5.0.0-rc1, 5.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Problem/Incident
causes SERVER-57434 Retry transaction on stale config err... Closed
is caused by SERVER-28943 Make shards retry non-write commands ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Sharding EMEA 2021-05-31
Participants:
Linked BF Score: 122

 Description   

The retried call to _commandExec() may cause a shard to return a NoSuchTransaction error response instead of its original StaleShardVersionError error response despite the router having been stale. Masking the original StaleConfig exception this way prevents the router from ever finding out it was stale. This behavior can lead a multi-statement transaction to perpetually be retried by the client and never succeed until the mongos refreshes for some other reason.

The calls to _commandExec() should be guarded by !opCtx->inMultiDocumentTransaction() similar to what was done for ShardCannotRefreshDueToLocksHeld.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-57051 Shard may fail to notify that router was stale for command in multi-statement transaction

(cherry picked from commit 4493d9309d2622844c41195baa6aadde2005362c)
Branch: v5.0
https://github.com/mongodb/mongo/commit/1769c4bb6b2ccb382aa4c95b35c0e3afe3d18cef

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-57051 Shard may fail to notify that router was stale for command in multi-statement transaction
Branch: master
https://github.com/mongodb/mongo/commit/4493d9309d2622844c41195baa6aadde2005362c

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