File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
scylla/src/policies/load_balancing Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,11 @@ use rand_pcg::Pcg32;
1717use scylla_cql:: frame:: response:: result:: TableSpec ;
1818use std:: hash:: { Hash , Hasher } ;
1919use std:: { fmt, sync:: Arc , time:: Duration } ;
20- use tracing:: { debug, warn } ;
20+ use tracing:: debug;
2121use uuid:: Uuid ;
2222
23+ const SANITY_CHECKS_WARNING_INTERVAL : std:: time:: Duration = std:: time:: Duration :: from_secs ( 1 ) ;
24+
2325#[ derive( Clone , Copy ) ]
2426enum NodeLocationCriteria < ' a > {
2527 Any ,
@@ -591,8 +593,6 @@ impl DefaultPolicy {
591593
592594 /// Checks for misconfiguration and warns if any is discovered.
593595 fn pick_sanity_checks ( & self , routing_info : & ProcessedRoutingInfo , cluster : & ClusterState ) {
594- const SANITY_CHECKS_WARNING_INTERVAL : std:: time:: Duration =
595- std:: time:: Duration :: from_secs ( 1 ) ;
596596 if let Some ( preferred_dc) = self . preferences . datacenter ( ) {
597597 // Preferred DC + no datacenter failover + SimpleStrategy is an anti-pattern.
598598 if let Some ( ref token_with_strategy) = routing_info. token_with_strategy {
@@ -677,7 +677,8 @@ You won't be able to execute any requests! This is most likely a misconfiguratio
677677 {
678678 nodes
679679 } else {
680- tracing:: warn!(
680+ warn_rate_limited ! (
681+ SANITY_CHECKS_WARNING_INTERVAL ,
681682 "Datacenter specified as the preferred one ({}) does not exist!" ,
682683 preferred_datacenter
683684 ) ;
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use std::sync::Arc;
44use uuid:: Uuid ;
55
66use crate :: cluster:: { ClusterState , Node , NodeRef } ;
7+ use crate :: observability:: driver_tracing:: warn_rate_limited;
78use crate :: routing:: Shard ;
89
910use super :: { LoadBalancingPolicy , RoutingInfo } ;
@@ -69,7 +70,8 @@ impl LoadBalancingPolicy for SingleTargetLoadBalancingPolicy {
6970 match node {
7071 Some ( node) => Some ( ( node, self . shard ) ) ,
7172 None => {
72- tracing:: warn!(
73+ warn_rate_limited ! (
74+ std:: time:: Duration :: from_secs( 1 ) ,
7375 "SingleTargetLoadBalancingPolicy failed to find requested node {:?} in cluster metadata." ,
7476 self . node_identifier
7577 ) ;
You can’t perform that action at this time.
0 commit comments