File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ impl Topology {
316
316
server_description : ServerDescription ,
317
317
mut state_lock : RwLockWriteGuard < ' _ , TopologyState > ,
318
318
) -> bool {
319
- let is_available = server_description. is_available ( ) ;
319
+ let server_type = server_description. server_type ;
320
320
// TODO RUST-232: Theoretically, `TopologyDescription::update` can return an error. However,
321
321
// this can only happen if we try to access a field from the isMaster response when an error
322
322
// occurred during the check. In practice, this can't happen, because the SDAM algorithm
@@ -325,7 +325,10 @@ impl Topology {
325
325
// properly inform users of errors that occur here.
326
326
match state_lock. update ( server_description, & self . common . options , self . downgrade ( ) ) {
327
327
Ok ( Some ( _) ) => {
328
- if is_available {
328
+ if server_type. is_data_bearing ( )
329
+ || ( server_type != ServerType :: Unknown
330
+ && state_lock. description . topology_type ( ) == TopologyType :: Single )
331
+ {
329
332
server. pool . mark_as_ready ( ) . await ;
330
333
}
331
334
true
You can’t perform that action at this time.
0 commit comments