[SERVER-39836] Allow updates to shard key value if the doc changes shards if the update is part of a multi-stmt txn Created: 26/Feb/19  Updated: 29/Oct/23  Resolved: 20/Mar/19

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

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-37757 High verbosity log line in batch writ... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2019-03-25
Participants:

 Description   

If an update to a document's shard key value will cause the document to change shards, we throw a WouldChangeOwningShard exception. This ticket is to handle this error for updates sent as a part of a multi-statement transaction.

In order to do this, we need to catch and re-throw this error in ServiceEntryPointCommon. In BatchWriteExec::executeBatch(), we should not abort the transaction on this error. Instead, we should run the delete-insert transaction created as part of SERVER-39835.

If the update is not a part of a multi-stmt txn, we will error.



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

Author:

{'name': 'jannaerin', 'username': 'jannaerin', 'email': 'golden.janna@gmail.com'}

Message: SERVER-39836 Allow updates to document shard key value if write is in transaction
Branch: master
https://github.com/mongodb/mongo/commit/4f32712c85b266bf7b4a96b402472309a7f18610

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