[SERVER-36580] Mongos should preserve error labels for write ops Created: 10/Aug/18  Updated: 29/Oct/23  Resolved: 28/Sep/18

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

Type: Task Priority: Major - P3
Reporter: Jack Mulrow Assignee: Randolph Tan
Resolution: Fixed Votes: 0
Labels: ShardedTxn:RouterSupport
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-522 Support mongos pinning for sharded tr... Closed
Related
is related to SERVER-35708 mongos does not attach errorLabels on... Closed
is related to SERVER-34256 On error within a transaction, expose... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2018-09-10, Sharding 2018-09-24, Sharding 2018-10-08
Participants:

 Description   

Mongos batches writes together and even if individual writes fail, the command response can return {ok: 1}. However, if any of the individual writes failed with an error label, that label will be lost.

The batch write path should be modified to preserve any error labels returned by writes in a batch.

This ticket includes determining how error labels encountered during batch writes should be handled, e.g. if two writes in an unordered batch fail but only one has the TransientTransactionError label, should the batch response include the label or not. Mongod addresses this by throwing if any statement in a batch fails within a transaction, so the solution may be adding this behavior to mongos.

This work was spun off from SERVER-35708.



 Comments   
Comment by Githook User [ 28/Sep/18 ]

Author:

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

Message: SERVER-36580 Write test for verifying that mongos preserves the error label from shards when executing write commands.
Branch: master
https://github.com/mongodb/mongo/commit/e9c9b87b155f3c50c71bbb15a989349152386530

Comment by Jack Mulrow [ 07/Sep/18 ]

My commit for SERVER-36557 made any errors encountered by mongos during a batch write get re-thrown (mimicking the behavior on mongod), so I think there might be nothing more to do for this ticket, except possibly add more targeted testing. We already pass the error label tests in core/txns though, so more tests may not be necessary.

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