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

Server 8.0+ requires tests for aggregation with $out to not pre-create output collection

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: CRUD
    • None
    • Needed
    • Hide

      Summary of necessary driver changes

      •  No functional changes have been made to the spec
      • Note: due to a tooling error, the crud-aggregate-write-readPreference.json test file was not updated in the original commit (30b3a75) and was updated in a separate commit (30251e8).

      Commits for syncing spec/prose tests
      (and/or refer to an existing language POC if needed)

      •  Synchronise the crud/db-aggregate-write-readPreference test to commit 30b3a75
      •  Synchronise the crud/aggregate-write-readPreference test to commit 30251e8

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes  No functional changes have been made to the spec Note: due to a tooling error, the crud-aggregate-write-readPreference.json test file was not updated in the original commit (30b3a75) and was updated in a separate commit (30251e8). Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)  Synchronise the crud/db-aggregate-write-readPreference test to commit 30b3a75  Synchronise the crud/aggregate-write-readPreference test to commit 30251e8 Context for other referenced/linked tickets  
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5579 Fixed 1.28.1
      CXX-3035 Fixed 3.10.3
      CSHARP-5098 Fixed 3.1.0
      GODRIVER-3219 Backlog 2.1.0
      JAVA-5481 Fixed 5.3.0
      NODE-6184 Fixed 6.10.0
      MOTOR-1318 Duplicate
      PYTHON-4453 Done 4.11
      PHPLIB-1458 Done
      RUBY-3480 Ready for Work
      RUST-1950 Backlog
      $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 CDRIVER-5579 Fixed 1.28.1 CXX-3035 Fixed 3.10.3 CSHARP-5098 Fixed 3.1.0 GODRIVER-3219 Backlog 2.1.0 JAVA-5481 Fixed 5.3.0 NODE-6184 Fixed 6.10.0 MOTOR-1318 Duplicate PYTHON-4453 Done 4.11 PHPLIB-1458 Done RUBY-3480 Ready for Work RUST-1950 Backlog

      Summary

      The unified tests for aggregations with an $out stage began failing with the 8.0 server versions. After investigation (SERVER-90047) it was determined that the new behavior is intentional, and drivers should update their tests accordingly.

      jeff.yemin@mongodb.com suggested the following fix:

      "It seems like a viable workaround would just be to remove the initialData section for coll1, e.g. this bit: https://github.com/mongodb/specifications/blob/master/source/crud/tests/unified/aggregate-write-readPreference.yml#L54-L56. If we do that, then the test will not attempt to create the collection at all, and $out will take care of it. And since $out replaces any existing documents in the collection with the output of the $out stage, the outcome will be the same."

      Besides crud/tests/unified/aggregate-write-readPreference.yml, this issue also affects at least crud/tests/unified/db-aggregate-write-readPreference.yml.

      Motivation

      Who is the affected end user?

      All drivers (potentially).

      How does this affect the end user?

      When run against server version 8.0+, the aggregation+$out specs fail with an error: "PlanExecutor error during aggregation :: caused by :: indexes of target collection db0.coll1 changed during processing".

      How likely is it that this problem or use case will occur?

      These specs consistently fail.

      If the problem does occur, what are the consequences and how severe are they?

      Build failures.

      Is this issue urgent?

      There is no user-facing impact. The consequences purely affect the mentioned subset of aggregation specs.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      Yes.

      Acceptance Criteria

      The aggregation CRUD specs must pass.

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Jeremy Mikola Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: