Skip to content

Commit

Permalink
Make tablet collation mismatch warning throttled (#4282)
Browse files Browse the repository at this point in the history
Signed-off-by: Jacques Grove <[email protected]>
Signed-off-by: Vicent Marti <[email protected]>
  • Loading branch information
aquarapid authored and vmg committed Feb 2, 2024
1 parent ea8a90d commit 0166c89
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/vt/vtgate/tabletgateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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() {
Expand Down Expand Up @@ -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")
}
}

Expand Down

0 comments on commit 0166c89

Please sign in to comment.