Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38734

POC for change the document shard key

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Sharding
    • None
    • Sharding 2018-12-31, Sharding 2019-01-14, Sharding 2019-01-28, Sharding 2019-02-11, Sharding 2019-02-25

    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

      Attachments

        Activity

          People

            janna.golden@mongodb.com Janna Golden
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: