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

Allow updates to shard key value if the doc changes shards if the update is part of a multi-stmt txn

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.1.10
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • Sharding 2019-03-25

      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.

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

              Created:
              Updated:
              Resolved: