[SERVER-39118] Mongos should not blindly pass 'hasWriteConcernError=false' to getErrorLabels Created: 22/Jan/19  Updated: 29/Oct/23  Resolved: 27/Feb/19

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

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

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2019-01-28, Sharding 2019-02-11, Sharding 2019-02-25, Sharding 2019-03-11
Participants:

 Description   

At the very least, if commitTransaction is sent to a recovery router, the recovery router could target a stale coordinator primary and get back NoSuchTransaction for coordinateCommitTransaction with a writeConcern error. The recovery router should not attach TransientTransactionError in this case, since the transaction may have committed.



 Comments   
Comment by Githook User [ 27/Feb/19 ]

Author:

{'name': 'Randolph Tan', 'username': 'renctan', 'email': 'randolph@10gen.com'}

Message: SERVER-39118 Add comment to explain why mongos pass 'hasWriteConcernError=false' to getErrorLabels
Branch: master
https://github.com/mongodb/mongo/commit/488f05c21a2b30e3eb9e49cd7014d20c81c6f740

Comment by Esha Maharishi (Inactive) [ 24/Jan/19 ]

Given that

1) commitTransaction on mongos just forwards the shard's response back to the client, which means getErrorLabels, which is called in a catch block, won't get called, and

2) commitTransaction on mongod and, as of SERVER-38978, coordinateCommitTransaction attach the appropriate error labels

the issue in the ticket description shouldn't occur.

I don't think writeConcern can be sent for regular transaction statements (besides commit/abort), so this may not be an issue... though perhaps worth a comment at the call site since it looks weird?

renctan

Comment by Gregory McKeon (Inactive) [ 22/Jan/19 ]

renctan to talk to Siyuan about this.

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