Skip to content

Commit ace6f89

Browse files
RUST-2179 Ignore whether nodes are data-bearing when directConnection is true
1 parent 537f555 commit ace6f89

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/sdam/description/topology/server_selection.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,12 @@ impl TopologyDescription {
124124
SelectionCriteria::Predicate(ref filter) => self
125125
.servers
126126
.values()
127-
.filter(|s| s.server_type.is_data_bearing() && filter(&ServerInfo::new_borrowed(s)))
127+
.filter(|s| {
128+
// If we're direct-connected or connected to a standalone, ignore whether the
129+
// single server in the topology is data-bearing.
130+
(self.topology_type == TopologyType::Single || s.server_type.is_data_bearing())
131+
&& filter(&ServerInfo::new_borrowed(s))
132+
})
128133
.collect(),
129134
};
130135

0 commit comments

Comments
 (0)