Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-440

Improve testing around default writeConcern

    • Type: Icon: Epic Epic
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • Labels:
      None
    • Not Needed
    • Hide

      This feature has been asked for quite some time by Cloud, so tagging that team. Docs, because it will have to be documented.

      Show
      This feature has been asked for quite some time by Cloud, so tagging that team. Docs, because it will have to be documented.
    • 100
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      NODE-2291 Fixed 3.6.0
      RUBY-2002 Fixed 2.13.0.beta1
      CSHARP-2841 Fixed 2.11.0
      JAVA-3499 Fixed 4.1.0
      CDRIVER-3426 Fixed 1.17.0-beta, 1.17.0
      MOTOR-456 Duplicate
      PYTHON-2037 Fixed 3.11
      PHPLIB-536 Fixed 1.7.0-beta1, 1.7.0
      GODRIVER-1398 Fixed 1.4.0
      CXX-1875 Fixed 3.6.0-rc0, 3.6.0
      RUST-367 Duplicate
      SWIFT-792 Won't Fix
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion NODE-2291 Fixed 3.6.0 RUBY-2002 Fixed 2.13.0.beta1 CSHARP-2841 Fixed 2.11.0 JAVA-3499 Fixed 4.1.0 CDRIVER-3426 Fixed 1.17.0-beta, 1.17.0 MOTOR-456 Duplicate PYTHON-2037 Fixed 3.11 PHPLIB-536 Fixed 1.7.0-beta1, 1.7.0 GODRIVER-1398 Fixed 1.4.0 CXX-1875 Fixed 3.6.0-rc0, 3.6.0 RUST-367 Duplicate SWIFT-792 Won't Fix

      Epic Summary

      Summary

      The existing tests for writeConcern imply that an empty document is a valid writeConcern to send to the server.

      https://github.com/mongodb/specifications/blob/master/source/read-write-concern/tests/document/write-concern.json#L3-L10

      In fact, the default writeConcern is no writeConcern (i.e. don't send the writeConcern field at all). This has come up in the past related to drivers accidentally overriding getLastErrorDefaults. It is coming up again in relation to PM-900.

      There have been two bugs filed and fixed in drivers related to this - CDRIVER-2273 and PYTHON-1523. Other drivers may have the same bug, since our existing tests don't catch it.

      Please add tests to ensure that drivers don't add the writeConcern option with an empty document to write commands when the application has not specified a write concern.

      Lead : Jeremy
      Author : Kevin
      POCs : C - Kevin

      Spec test change

      SPEC-1352 introduces a new spec test format for the read/write concern tests, mostly equivalent to existing transactions/CRUD spec tests, to verify that write operations do not include a default write concern:

            Assignee:
            Unassigned Unassigned
            Reporter:
            rathi.gnanasekaran Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: