Skip to content

Commit

Permalink
fix: always return empty array for selection on unknown topology
Browse files Browse the repository at this point in the history
Topology types of `Unknown` should always return an empty set of
servers for server selection using a read preference

NODE-2549
  • Loading branch information
mbroadst committed Apr 8, 2020
1 parent d6f3001 commit f9e786a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core/sdam/server_selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ function readPreferenceServerSelector(readPreference) {
);
}

if (topologyDescription.type === TopologyType.Unknown) {
return [];
}

if (
topologyDescription.type === TopologyType.Single ||
topologyDescription.type === TopologyType.Sharded
Expand Down

0 comments on commit f9e786a

Please sign in to comment.