Update to shard key can fail when document contains $ fields

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Cluster Scalability
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When an update to a document's shard key reassigns it to a new shard, mongos dispatches a delete command to the original shard consisting of the original document's full contents (it's pre-image). That ensures that only the exact document that was updated can get deleted, but the delete command fails to parse if any field names in the document begin with a $ character.

      "errmsg" : "Update operation was converted into a distributed transaction because the document being updated would move shards and that transaction failed. :: caused by :: findAndModify :: caused by :: During delete stage of updating a shard key :: caused by :: Could not parse delete query \{ _id: 1.0, shard: 1.0, x: 1.0, y: { $numberDecimal: 100.0 } } :: caused by :: unknown operator: $numberDecimal"
      

            Assignee:
            Unassigned
            Reporter:
            Justin Seyster
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: