[SERVER-38734] POC for change the document shard key Created: 20/Dec/18  Updated: 22/Feb/19  Resolved: 22/Feb/19

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

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

Sprint: Sharding 2018-12-31, Sharding 2019-01-14, Sharding 2019-01-28, Sharding 2019-02-11, Sharding 2019-02-25
Participants:

 Description   

This ticket is to track work for the change the document shard key project. We plan to implement this by making MongoS drive the update of the shard key with some information returned from MongoD. A high level overview of the steps are as follows:
1. MongoS passes the entire update statement to MongoD as-is (without checking whether it updates the shard key or not)
2. UpdateDriver performs the update on the pre-image of the document, without checking whether it modifies the shard key or not and returns a post-image to the UpdateStage, whose responsibility is to write the post-image
3. UpdateStage uses shard filtering metadata to decide whether the update will cause the document to change shards. If it does, UpdateStage will throw a WouldChangeOwningShard exception with attached ErrorExtraInfo which will contain the original shard key and the post-image. This exception will be returned all the way to MongoS.
4. MongoS will catch this exception and start a new transaction to insert the updated document on the new owning shard and delete the old document from the previous owning shard


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