From 4e31f60c43456ce1a28b15d36e4f1b6742e62729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicent=20Mart=C3=AD?= <42793+vmg@users.noreply.github.com> Date: Fri, 9 Feb 2024 10:43:17 +0100 Subject: [PATCH] Make tablet collation mismatch warning throttled (#15123) Signed-off-by: Jacques Grove Signed-off-by: Vicent Marti Co-authored-by: aquarapid --- go/vt/vtgate/tabletgateway.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/vt/vtgate/tabletgateway.go b/go/vt/vtgate/tabletgateway.go index d1846168a43..b289cf3b74e 100644 --- a/go/vt/vtgate/tabletgateway.go +++ b/go/vt/vtgate/tabletgateway.go @@ -31,6 +31,7 @@ import ( "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/vt/discovery" "vitess.io/vitess/go/vt/log" + "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/servenv" "vitess.io/vitess/go/vt/srvtopo" "vitess.io/vitess/go/vt/topo" @@ -52,6 +53,8 @@ var ( initialTabletTimeout = 30 * time.Second // retryCount is the number of times a query will be retried on error retryCount = 2 + + logCollations = logutil.NewThrottledLogger("CollationInconsistent", 1*time.Minute) ) func init() { @@ -435,7 +438,7 @@ func (gw *TabletGateway) updateDefaultConnCollation(tablet *topodatapb.Tablet) { return } if gw.defaultConnCollation.Load() != tablet.DefaultConnCollation { - log.Warning("this Vitess cluster has tablets with different default connection collations") + logCollations.Warningf("this Vitess cluster has tablets with different default connection collations") } }