Skip to content

Commit

Permalink
check always-on heartbeat config before on-demand
Browse files Browse the repository at this point in the history
Signed-off-by: deepthi <deepthi@planetscale.com>
  • Loading branch information
deepthi committed Feb 21, 2025
1 parent c9c227d commit 3e1f28e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go/vt/vttablet/tabletserver/repltracker/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ func newHeartbeatWriter(env tabletenv.Env, alias *topodatapb.TabletAlias) *heart
configType := HeartbeatConfigTypeNone
onDemandDuration := defaultOnDemandDuration
switch {
case config.ReplicationTracker.Mode == tabletenv.Heartbeat:
configType = HeartbeatConfigTypeAlways
onDemandDuration = 0
case config.ReplicationTracker.HeartbeatOnDemand > 0:
configType = HeartbeatConfigTypeOnDemand
onDemandDuration = config.ReplicationTracker.HeartbeatOnDemand
if onDemandDuration < minimalOnDemandDuration {
onDemandDuration = minimalOnDemandDuration
}
case config.ReplicationTracker.Mode == tabletenv.Heartbeat:
configType = HeartbeatConfigTypeAlways
onDemandDuration = 0
}
heartbeatInterval := config.ReplicationTracker.HeartbeatInterval
if heartbeatInterval == 0 {
Expand Down

0 comments on commit 3e1f28e

Please sign in to comment.