Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-8623

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

    • Type: Icon: Investigation Investigation
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • Developer Tools

      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:
            kraen.hansen@mongodb.com Kræn Hansen
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: