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

Support $merge and $out executing on secondaries

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

      If an $out or $merge aggregate operation is delivered to a secondary node, and the operation has non-primary read preference, the operation will now work as expected. In previous versions, the operation would fail with a NotMaster category error. However, drivers have chosen not to add explicit support for this feature in their 4.4-compatible releases. There may be a way in some drivers to access this feature using a lower-level API. However, since the drivers are not changing to respect non-primary read preference for $out/$merge operations in 4.4, there should be no immediate downstream impact.

      Show
      If an $out or $merge aggregate operation is delivered to a secondary node, and the operation has non-primary read preference, the operation will now work as expected. In previous versions, the operation would fail with a NotMaster category error. However, drivers have chosen not to add explicit support for this feature in their 4.4-compatible releases. There may be a way in some drivers to access this feature using a lower-level API. However, since the drivers are not changing to respect non-primary read preference for $out/$merge operations in 4.4, there should be no immediate downstream impact.
    • Hide

      As of MongoDB 5.0, drivers can support read preferences (either explicit/per-operation or inherited) for aggregations including an $out/$merge stage. Previously, such pipelines would always require a primary.

      Drivers should sync unified CRUD tests to mongodb/specifications@5f8f668. If possible, drivers may consider implementing DRIVERS-1958 alongside this ticket and sync to mongodb/specifications@dce2c48, which fixes an issue with the original spec tests for DRIVERS-823.

      The outdated "$out Aggregation Pipeline Operator" specification was also deleted. All relevant information for $out/$merge is now discussed in the CRUD spec (and parts of Server Selection).

      Note: DRIVERS-1969 revises behavior for applying a read preference. Drivers that have yet to implement DRIVERS-823 should consider that ticket when picking up this work. DRIVERS-1969 does not change any spec tests.

      Show
      As of MongoDB 5.0, drivers can support read preferences (either explicit/per-operation or inherited) for aggregations including an $out/$merge stage. Previously, such pipelines would always require a primary. Drivers should sync unified CRUD tests to mongodb/specifications@5f8f668 . If possible, drivers may consider implementing DRIVERS-1958 alongside this ticket and sync to mongodb/specifications@dce2c48 , which fixes an issue with the original spec tests for DRIVERS-823 . The outdated "$out Aggregation Pipeline Operator" specification was also deleted. All relevant information for $out/$merge is now discussed in the CRUD spec (and parts of Server Selection). Note: DRIVERS-1969 revises behavior for applying a read preference. Drivers that have yet to implement DRIVERS-823 should consider that ticket when picking up this work. DRIVERS-1969 does not change any spec tests.
    • Hide

      Lead: Jeremy

      Summary: Allow an aggregation with a $merge or $out stage to respect the user-specified read preference rather than unconditionally using read preference primary.

      2021-09-22:

      • Spec PR close to getting wrapped up
      • Go and PHP implementations in code review

      Show
      Lead: Jeremy Summary: Allow an aggregation with a $merge or $out stage to respect the user-specified read preference rather than unconditionally using read preference primary. 2021-09-22: Spec PR close to getting wrapped up Go and PHP implementations in code review
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      RUBY-2526 Fixed 2.17.0
      PYTHON-2554 Fixed 4.1
      RUST-663 Backlog
      GODRIVER-1868 Done 1.8.0
      JAVA-3994 Fixed 4.4.0
      CXX-2184 Done 3.8.0
      MOTOR-666 Duplicate
      CDRIVER-3893 Done 1.21.0
      SWIFT-1105 Won't Do
      NODE-3083 Fixed 4.2.0
      CSHARP-3397 Done 2.15.0
      PHPLIB-651 Fixed 1.10.0
      $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 RUBY-2526 Fixed 2.17.0 PYTHON-2554 Fixed 4.1 RUST-663 Backlog GODRIVER-1868 Done 1.8.0 JAVA-3994 Fixed 4.4.0 CXX-2184 Done 3.8.0 MOTOR-666 Duplicate CDRIVER-3893 Done 1.21.0 SWIFT-1105 Won't Do NODE-3083 Fixed 4.2.0 CSHARP-3397 Done 2.15.0 PHPLIB-651 Fixed 1.10.0

      Description of Linked Ticket

      Epic Summary

      Summary

      Motivation

      Cast of Characters

      • Product Owner: Katya Kamenieva
      • Project Lead: David Storch
      • Program Manager: Craig Homa.

      Documentation

      Server Scope Document
      Server Technical Design Document
      Driver Scope Document
      Slack channel: #drivers-823-out-merge-on-secondaries

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: