[CSHARP-4290] Incorrect feature version for "AggregateOutOnSecondary" Created: 04/Aug/22  Updated: 27/Oct/23  Resolved: 29/Aug/22

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Spec Change Priority: Unknown
Reporter: Maks Shapovalov Assignee: James Kovacs
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to DOCS-15540 Drivers require 5.0 cluster to enable... Closed

 Description   

Summary

There is 

WireVersion.Server50

 in code, but corresponding to documentation feature is available starts from 4.4

Links:
https://www.mongodb.com/docs/manual/reference/operator/aggregation/merge/
_https://www.mongodb.com/docs/manual/reference/operator/aggregation/out/_

What should do:

Pass 

WireVersion.Server44

for 

__aggregateOutOnSecondary



 Comments   
Comment by PM Bot [ 29/Aug/22 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information.

Comment by James Kovacs [ 12/Aug/22 ]

Hi, azeriker@gmail.com,

We have investigated this issue and it was a conscious design decision for drivers to only support $out on secondaries when running against 5.0 or later clusters. There were nuances with mixed version clusters (which can occur when upgrading large deployments) that made it difficult to support this feature in our drivers on MongoDB 4.4.

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.

To use $out on secondaries, you have two options currently:

1. If you are running a 4.4 cluster, you can run $out on secondaries using the mongo shell.
2. If you are running a 5.0 or later cluster, you can run $out on secondaries using any driver that currently supports this feature. (See DRIVERS-823 for a list of drivers that have implemented this feature.)

I have filed DOCS-15540 to correct our documentation.

Please let us know if you have any additional questions or concerns.

Sincerely,
James

Comment by Maks Shapovalov [ 08/Aug/22 ]

Also u can assign me after approve, I can fix it and create PR

Comment by Esha Bhargava [ 05/Aug/22 ]

azeriker@gmail.com Thank you for reporting this issue. We'll look into it and get back to you soon.

Generated at Wed Feb 07 21:47:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.