Skip to content

Commit

Permalink
Slack 15.0 vtgate log wait tgts (#569)
Browse files Browse the repository at this point in the history
This adds logging to healthcheck wait for tablet types so we know where it's stuck - if anywhere.

Signed-off-by: Eduardo J. Ortega U. <5791035+ejortegau@users.noreply.github.com>
  • Loading branch information
ejortegau authored Dec 2, 2024
1 parent f75d407 commit 2f80169
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@ func (hc *HealthCheckImpl) WaitForAllServingTablets(ctx context.Context, targets

// waitForTablets is the internal method that polls for tablets.
func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.Target, requireServing bool) error {
log.Infof("Starting wait for tablets loop...")
waitLogSoFar := 0 * time.Second
waitLogPeriod := 5 * time.Second

for {
// We nil targets as we find them.
allPresent := true
Expand Down Expand Up @@ -770,6 +774,18 @@ func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.
}
return ctx.Err()
case <-timer.C:
waitLogSoFar += waitAvailableTabletInterval
if waitLogSoFar >= waitLogPeriod {
waitLogSoFar = 0
var nonNilTargets = []query.Target{}
for _, target := range targets {
if target != nil {
nonNilTargets = append(nonNilTargets, query.Target{Keyspace: target.Keyspace, Shard: target.Shard,
TabletType: target.TabletType, Cell: target.Cell})
}
}
log.Infof("Still waiting for targets %+v", nonNilTargets)
}
}
}
}
Expand Down

0 comments on commit 2f80169

Please sign in to comment.