Skip to content

Commit

Permalink
Don't spam the logs.
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurschreiber committed Jul 9, 2024
1 parent 697a53d commit c08b38b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,13 @@ func (hc *HealthCheckImpl) updateHealth(th *TabletHealth, prevTarget *query.Targ
th.PrimaryTermStartTime,
hc.healthy[targetKey][0].PrimaryTermStartTime)
} else {
log.Warningf("new healthy primary %s for %s is up, replacing previous primary %s",
topoproto.TabletAliasString(th.Tablet.Alias),
topoproto.KeyspaceShardString(th.Target.Keyspace, th.Target.Shard),
topoproto.TabletAliasString(hc.healthy[targetKey][0].Tablet.Alias))
if hc.healthy[targetKey][0].Tablet.Alias != th.Tablet.Alias {
log.Warningf("new healthy primary %s for %s is up, replacing previous primary %s",
topoproto.TabletAliasString(th.Tablet.Alias),
topoproto.KeyspaceShardString(th.Target.Keyspace, th.Target.Shard),
topoproto.TabletAliasString(hc.healthy[targetKey][0].Tablet.Alias))
}

// Just replace it.
hc.healthy[targetKey][0] = th
}
Expand Down

0 comments on commit c08b38b

Please sign in to comment.