File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
sdam/description/topology Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -497,6 +497,15 @@ impl Client {
497
497
} else {
498
498
criteria
499
499
} ;
500
+
501
+ if operation_name == "insert" || operation_name == "find" {
502
+ let servers = & state. description . servers ;
503
+ for ( address, description) in servers {
504
+ dbg ! ( "address: {}" , address) ;
505
+ dbg ! ( "type: {}" , description. server_type) ;
506
+ }
507
+ }
508
+
500
509
let result = server_selection:: attempt_to_select_server (
501
510
effective_criteria,
502
511
& state. description ,
Original file line number Diff line number Diff line change @@ -318,6 +318,11 @@ impl Client {
318
318
. and_then ( |s| s. transaction . pinned_mongos ( ) )
319
319
. or_else ( || op. selection_criteria ( ) ) ;
320
320
321
+ if op. name ( ) == "insert" || op. name ( ) == "find" {
322
+ let first_server = retry. as_ref ( ) . map ( |r| & r. first_server ) ;
323
+ dbg ! ( "deprioritized: {}" , & first_server) ;
324
+ }
325
+
321
326
let ( server, effective_criteria) = match self
322
327
. select_server (
323
328
selection_criteria,
Original file line number Diff line number Diff line change @@ -61,7 +61,13 @@ pub(crate) fn attempt_to_select_server<'a>(
61
61
servers : & ' a HashMap < ServerAddress , Arc < Server > > ,
62
62
deprioritized : Option < & ServerAddress > ,
63
63
) -> Result < Option < SelectedServer > > {
64
+ let log = deprioritized. is_some ( ) ;
65
+
64
66
let mut in_window = topology_description. suitable_servers_in_latency_window ( criteria) ?;
67
+ if log {
68
+ dbg ! ( "in window: {}" , & in_window) ;
69
+ }
70
+
65
71
if let Some ( addr) = deprioritized {
66
72
if in_window. len ( ) > 1 {
67
73
in_window. retain ( |d| & d. address != addr) ;
You can’t perform that action at this time.
0 commit comments