[SERVER-48307] Transactions that write to exactly one shard and read from one or more other shards may incorrectly indicate failure on retry after successful commit Created: 19/May/20  Updated: 29/Oct/23  Resolved: 20/May/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 4.5.1, 4.2.7, 4.4.0-rc6
Fix Version/s: 4.2.8, 4.4.0-rc7, 4.7.0

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-48340 Re-enable single-write-shard transact... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2
Sprint: Sharding 2020-06-01
Participants:

 Description   

 

Issue Status as of May 25, 2020

ISSUE SUMMARY
Distributed transactions which write to document(s) on exactly one shard and read document(s) from at least one other shard may execute more than once in the presence of a primary failover.

This issue does not affect multi-document transactions involving a single shard or that write to multiple shards.

When a client attempts to commit a multi-document transaction, the driver receives one of the following responses to the commitTransaction command:

  1. The transaction has definitively committed.
  2. The transaction has definitively aborted.
  3. It is unknown whether the transaction has committed or aborted.

Clients using either driver’s callback transactions API or driver’s core transactions API would automatically retry the commitTransaction command to learn the definitive result of the transaction.

Due to a bug in the router, the driver may be wrongly told “the transaction has definitely aborted and its operation should be automatically retried in a new transaction,” when the transaction has successfully been committed. This bug manifests when the commitTransaction command must be retried to learn the definitive result of the transaction and a primary failover has occurred in the intervening time on one of the shards that document(s) were only read from.

USER IMPACT
Distributed transactions which write to document(s) on exactly one shard and read document(s) from at least one other shard may execute more than once.

AFFECTED VERSIONS
This affects 4.2.7 and earlier versions of 4.2.

FIX VERSION
The fix will be included in 4.4.0 and 4.2.8.



 Comments   
Comment by Githook User [ 19/Aug/20 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-48341 Remove requires_fcv_44 from tests blacklisted under SERVER-48307
Branch: v4.4
https://github.com/mongodb/mongo/commit/52357b37f74e561b5e9edf95733399e01a4d303f

Comment by Githook User [ 26/Jun/20 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-48341 Remove requires_fcv_46 from tests blacklisted under SERVER-48307
Branch: master
https://github.com/mongodb/mongo/commit/e976a66489bb0b600d9896bdada5e33e6d885534

Comment by Githook User [ 21/May/20 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-48307 Disable single-write-shard transaction commit optimization

(cherry picked from commit e18f218d59237398962b8b5e3730f28c0f06e587)
Branch: v4.2
https://github.com/mongodb/mongo/commit/539db971814c1d2dbcea6f1fa28f59eea737a16b

Comment by Githook User [ 20/May/20 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-48307 Disable single-write-shard transaction commit optimization

(cherry picked from commit e18f218d59237398962b8b5e3730f28c0f06e587)
Branch: v4.4
https://github.com/mongodb/mongo/commit/607a0ac8c11e32af57aafe56f8adfd80f5d03b4b

Comment by Githook User [ 20/May/20 ]

Author:

{'name': 'Esha Maharishi', 'email': 'esha.maharishi@mongodb.com', 'username': 'EshaMaharishi'}

Message: SERVER-48307 Disable single-write-shard transaction commit optimization
Branch: master
https://github.com/mongodb/mongo/commit/be253e1614bb05dc9a9ace507b263fb4885dcdee

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