Details
-
Spec Change
-
Status: Closed
-
Major - P3
-
Resolution: Done
-
None
-
Needed
-
Description
Currently the specification says:
- If an explicit (i.e. per-operation) read preference is specified for an
|
aggregation with a write stage, drivers MUST attempt to use it. If that would
|
result in a pre-5.0, secondary server being selected, drivers MUST instead
|
select a server using a primary read preference.
|
- If no explicit read preference is specified but a default read preference is
|
available to inherit (e.g. from the Collection), drivers MUST attempt to use
|
it. If that would result in a pre-5.0, secondary server being selected,
|
drivers MUST instead select a server using a primary read preference.
|
Defining it precisely in terms of available and eligible servers (the language of the server selection specification) would be more prescriptive and reduce differences in driver implementations. Something like this:
If an explicit (i.e. per-operation) or default (i.e., specified on a collection object)
|
read preference is specified for an aggregation with a write stage,
|
drivers use this logic to determine the list of eligible servers to consider:
|
|
If there are any *available* pre-5.0 servers, drivers MUST fall back to using primary
|
read preference to determine the list of *eligible* servers.
|
Otherwise, drivers MUST apply the read preference to determine the list of *eligible* servers.
|
Examples (all with secondary read preference):
- a 5.0 primary and no secondaries -> apply read preference (no eligible servers)
- a 5.0 primary and a 5.0 secondary -> apply read preference (one eligible server)
- no available servers -> apply read preference (no eligible servers)
- a 4.4 primary and a 5.0 secondary -> fallback to primary (one eligible server)
Attachments
Issue Links
- is depended on by
-
PYTHON-2554 Support $merge and $out executing on secondaries
-
- Closed
-
- is related to
-
DRIVERS-823 Support $merge and $out executing on secondaries
-
- Implementing
-
-
JAVA-4380 Fix server selection logic for $out/$merge on secondary
-
- Closed
-
-
DRIVERS-1955 CRUD spec for $out/$merge on secondaries should consider load balancers
-
- Closed
-
- split to
-
PHPLIB-760 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
CDRIVER-4224 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
CSHARP-3957 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
CXX-2414 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
GODRIVER-2220 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
JAVA-4396 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
MOTOR-859 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
NODE-3752 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
PYTHON-3012 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
RUBY-2841 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-
-
RUST-1097 Ignore read preference for $out/$merge on secondaries if any servers are pre-5.0
-
- Closed
-