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
    • Labels:
      None
    • Needed
    • Hide

      Summary of necessary driver changes

      •  

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

      •  

      Context for other referenced/linked tickets

      •  
      Show
      Summary of necessary driver changes   Commits for syncing spec/prose tests (and/or refer to an existing language POC if needed)   Context for other referenced/linked tickets  
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-5579 Blocked
      CXX-3035 Blocked
      CSHARP-5098 Blocked
      GODRIVER-3219 Blocked
      JAVA-5481 Blocked
      NODE-6184 Blocked
      MOTOR-1318 Blocked
      PYTHON-4453 Blocked
      PHPLIB-1458 Blocked
      RUBY-3480 Blocked
      RUST-1950 Blocked
      $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 Blocked CXX-3035 Blocked CSHARP-5098 Blocked GODRIVER-3219 Blocked JAVA-5481 Blocked NODE-6184 Blocked MOTOR-1318 Blocked PYTHON-4453 Blocked PHPLIB-1458 Blocked RUBY-3480 Blocked RUST-1950 Blocked

      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:
            Unassigned Unassigned
            Reporter:
            jamis.buck@mongodb.com Jamis Buck
            Jeremy Mikola Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: