[JAVA-4380] Fix server selection logic for $out/$merge on secondary Created: 28/Oct/21  Updated: 28/Oct/23  Resolved: 10/Nov/21

Status: Closed
Project: Java Driver
Component/s: Query Operations
Affects Version/s: None
Fix Version/s: 4.4.0

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-4396 Ignore read preference for $out/$merg... Closed
Related
related to DRIVERS-1969 Ignore read preference for $out/$merg... Closed
Documentation Changes: Not Needed

 Description   

In mongodb/specifications@747b748, the rules were applying a read preference for aggregations using $out and $merge was changed. Previously, drivers were instructed to attempt using the read preference and only fall back to a primary if a pre-5.0 secondary was selected.

This was changed to require drivers to always disregard the read preference if there is any evidence of a pre-5.0 server. If there are either no available servers or all servers are 5.0+ (or load balanced, where we assume 5.0+), drivers can utilize the read preference.

Spec tests have not been changed, as this clarification really only changes behavior for mixed version clusters or a replica set consisting of a single pre-5.0 primary, neither of which are tested.



 Comments   
Comment by Githook User [ 10/Nov/21 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@mongodb.com', 'username': 'jyemin'}

Message: Update server selection logic for $out/$merge aggregation pipelines (#818)

JAVA-4380
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/6f49b5cd718e12d028afb094c06d2ba3c14aaccb

Comment by Jeremy Mikola [ 08/Nov/21 ]

jeff.yemin: Assuming this is the ticket you mean to use for DRIVERS-1969, I think you'll want to add a "split from" relationship and delete JAVA-4396. Note that using "split from" originally would have prevented JIRA automation from spawning JAVA-4396 when the DRIVERS ticket advanced states.

Comment by Jeffrey Yemin [ 04/Nov/21 ]

In Draft Review. Waiting on DRIVERS-1969.

Generated at Thu Feb 08 09:01:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.