@@ -95,11 +95,13 @@ static bool
9595_mongoc_topology_update_no_lock (uint32_t id ,
9696 const bson_t * hello_response ,
9797 int64_t rtt_msec ,
98+ mongoc_topology_description_hello_cluster_time_strategy_t cluster_time_strategy ,
9899 mongoc_topology_description_t * td ,
99100 const mongoc_log_and_monitor_instance_t * log_and_monitor ,
100101 const bson_error_t * error /* IN */ )
101102{
102- mongoc_topology_description_handle_hello (td , log_and_monitor , id , hello_response , rtt_msec , error );
103+ mongoc_topology_description_handle_hello (
104+ td , log_and_monitor , id , hello_response , rtt_msec , cluster_time_strategy , error );
103105
104106 /* return false if server removed from topology */
105107 return mongoc_topology_description_server_by_id (td , id , NULL ) != NULL ;
@@ -130,8 +132,13 @@ _mongoc_topology_scanner_setup_err_cb(uint32_t id, void *data, const bson_error_
130132 // Use `mc_tpld_unsafe_get_mutable` to get a mutable topology description
131133 // without locking. This function only applies to single-threaded clients.
132134 mongoc_topology_description_t * td = mc_tpld_unsafe_get_mutable (topology );
133- mongoc_topology_description_handle_hello (
134- td , & topology -> log_and_monitor , id , NULL /* hello reply */ , -1 /* rtt_msec */ , error );
135+ mongoc_topology_description_handle_hello (td ,
136+ & topology -> log_and_monitor ,
137+ id ,
138+ NULL /* hello reply */ ,
139+ -1 /* rtt_msec */ ,
140+ MONGOC_TOPOLOGY_DESCRIPTION_HELLO_CLUSTER_TIME_IGNORE ,
141+ error );
135142 }
136143}
137144
@@ -181,13 +188,25 @@ _mongoc_topology_scanner_cb(
181188 * client MUST change its type to Unknown only after it has retried the
182189 * server once." */
183190 if (!hello_response && sd && sd -> type != MONGOC_SERVER_UNKNOWN ) {
184- _mongoc_topology_update_no_lock (id , hello_response , rtt_msec , td , & topology -> log_and_monitor , error );
191+ _mongoc_topology_update_no_lock (id ,
192+ hello_response ,
193+ rtt_msec ,
194+ MONGOC_TOPOLOGY_DESCRIPTION_HELLO_CLUSTER_TIME_IGNORE ,
195+ td ,
196+ & topology -> log_and_monitor ,
197+ error );
185198
186199 /* add another hello call to the current scan - the scan continues
187200 * until all commands are done */
188201 mongoc_topology_scanner_scan (topology -> scanner , sd -> id );
189202 } else {
190- _mongoc_topology_update_no_lock (id , hello_response , rtt_msec , td , & topology -> log_and_monitor , error );
203+ _mongoc_topology_update_no_lock (id ,
204+ hello_response ,
205+ rtt_msec ,
206+ MONGOC_TOPOLOGY_DESCRIPTION_HELLO_CLUSTER_TIME_IGNORE ,
207+ td ,
208+ & topology -> log_and_monitor ,
209+ error );
191210
192211 /* The processing of the hello results above may have added, changed, or
193212 * removed server descriptions. We need to reconcile that with our
@@ -1444,8 +1463,13 @@ _mongoc_topology_update_from_handshake(mongoc_topology_t *topology, const mongoc
14441463 tdmod = mc_tpld_modify_begin (topology );
14451464
14461465 /* return false if server was removed from topology */
1447- has_server = _mongoc_topology_update_no_lock (
1448- sd -> id , & sd -> last_hello_response , sd -> round_trip_time_msec , tdmod .new_td , & topology -> log_and_monitor , NULL );
1466+ has_server = _mongoc_topology_update_no_lock (sd -> id ,
1467+ & sd -> last_hello_response ,
1468+ sd -> round_trip_time_msec ,
1469+ MONGOC_TOPOLOGY_DESCRIPTION_HELLO_CLUSTER_TIME_UPDATE ,
1470+ tdmod .new_td ,
1471+ & topology -> log_and_monitor ,
1472+ NULL );
14491473
14501474 /* if pooled, wake threads waiting in mongoc_topology_server_by_id */
14511475 mongoc_cond_broadcast (& topology -> cond_client );
@@ -1557,7 +1581,6 @@ _mongoc_topology_update_cluster_time(mongoc_topology_t *topology, const bson_t *
15571581 _mongoc_cluster_time_greater (& cluster_time , & tdmod .new_td -> cluster_time )) {
15581582 bson_destroy (& tdmod .new_td -> cluster_time );
15591583 bson_copy_to (& cluster_time , & tdmod .new_td -> cluster_time );
1560- _mongoc_topology_scanner_set_cluster_time (topology -> scanner , & tdmod .new_td -> cluster_time );
15611584 mc_tpld_modify_commit (tdmod );
15621585 } else {
15631586 mc_tpld_modify_drop (tdmod );
0 commit comments