Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3724

Investigate changes in SERVER-97470: findAndModify: Mongos WriteConcernError Behavior Differs from Mongod

    • Type: Icon: Investigation Investigation
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator

      Original Downstream Change Summary

      When running the `findAndModify` command against a sharded cluster, mongos could previously discard the `writeConcernError` field retrieved from a shard in case the shard response also contained an error, i.e. `

      {"ok":0}

      `.
      This was a behavior difference to how replica sets respond: replica sets will keep the `writeConcernError` field even in case the command fails with `

      {"ok":0}

      `.
      This change adjusts the mongos response in sharded clusters so that it does not discard the `writeConcernError` field if a shard responds to a `findAndModify` command with `

      {"ok":0}

      `.
      In case a `findAndModify` command was answered by a shard with `

      {"ok":1}

      `, mongos did not previously discard the `writeConcernError` field. This case thus remains unchanged.

      Description of Linked Ticket

      The changes for SERVER-78311 introduces mongos_noop_writes_wait_for_write_concern.js, a variant of noop_writes_wait_for_write_concern.js that goes through mongos. SERVER-78311 addresses inconsistencies that caused the update/insert commands to fail, but there are still a number of commands whose tests cases are disabled due to differing behavior.
      This ticket is spawned off from SERVER-80103 to investigate/address findAndModify.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: