[DOCS-15540] Drivers require 5.0 cluster to enable $out on secondaries Created: 12/Aug/22  Updated: 13/Nov/23  Resolved: 11/Jul/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 5.0.0, 6.0.0, 6.3, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Task Priority: Minor - P4
Reporter: James Kovacs Assignee: Rea Rustagi
Resolution: Done Votes: 0
Labels: quick-win, server-docs-bug-bash
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CSHARP-4290 Incorrect feature version for "Aggreg... Closed
Participants:
Days since reply: 30 weeks, 1 day ago

 Description   

$out notes:

Starting in MongoDB 4.4, $out can run on replica set secondary nodes if all the nodes in cluster have featureCompatibilityVersion set to 4.4 or higher and the Read Preference is set to secondary.

However Drivers made the decision to only support this feature on 5.0+ clusters. The Server Selection spec says:

For pre-5.0 servers, an aggregate command is "must-use-primary" if its
pipeline contains a write stage (e.g. ``$out``, ``$merge``); otherwise, it
is "may-use-secondary". For 5.0+ servers, secondaries can execute an
aggregate command with a write stage and all aggregate commands are
"may-use-secondary". This is discussed in more detail in
Read preferences and server selection in the CRUD spec.

DRIVERS-823 / CSHARP-3397 which implements this feature also says:

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.

Our documentation should note that $out on secondaries is only available for 5.0+ clusters, not 4.4+ clusters.



 Comments   
Comment by Rea Rustagi [ 11/Jul/23 ]

https://github.com/10gen/docs-mongodb-internal/pull/3661

Generated at Thu Feb 08 08:13:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.