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 {
316316 server_description : ServerDescription ,
317317 mut state_lock : RwLockWriteGuard < ' _ , TopologyState > ,
318318 ) -> bool {
319- let is_available = server_description. is_available ( ) ;
319+ let server_type = server_description. server_type ;
320320 // TODO RUST-232: Theoretically, `TopologyDescription::update` can return an error. However,
321321 // this can only happen if we try to access a field from the isMaster response when an error
322322 // occurred during the check. In practice, this can't happen, because the SDAM algorithm
@@ -325,7 +325,10 @@ impl Topology {
325325 // properly inform users of errors that occur here.
326326 match state_lock. update ( server_description, & self . common . options , self . downgrade ( ) ) {
327327 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+ {
329332 server. pool . mark_as_ready ( ) . await ;
330333 }
331334 true
You can’t perform that action at this time.
0 commit comments