Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack 15.0 vtgate log wait tgts #569

Open
wants to merge 3 commits into
base: slack-15.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading