Skip to content

Commit

Permalink
Add logging to debug CI failures
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo J. Ortega U. <[email protected]>
  • Loading branch information
ejortegau committed Feb 3, 2025
1 parent c59a642 commit bc1d135
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions go/test/endtoend/cluster/cluster_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ func (cluster *LocalProcessCluster) AddShard(keyspaceName string, shardName stri
for _, proc := range mysqlctlProcessList {
if err := proc.Wait(); err != nil {
log.Errorf("unable to start mysql process %v: %v", proc, err)
log.Errorf("Stdout: %s", proc.Stdout)
log.Errorf("Stderr: %s", proc.Stderr)
return nil, err
}
}
Expand Down
3 changes: 2 additions & 1 deletion go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ func NewHealthCheck(ctx context.Context, retryDelay, healthCheckTimeout time.Dur
func (hc *HealthCheckImpl) AddTablet(tablet *topodata.Tablet) {
// check whether grpc port is present on tablet, if not return
if tablet.PortMap["grpc"] == 0 {
log.Infof("grpc port missing for tablet, not adding: %v", tablet.PortMap)
return
}

Expand Down Expand Up @@ -831,7 +832,7 @@ func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.
timer.Stop()
for _, target := range targets {
if target != nil {
log.Infof("couldn't find tablets for target: %v", target)
log.Infof("couldn't find tablets for target: %v - Require serving is %+v", target, requireServing)
}
}
return ctx.Err()
Expand Down
7 changes: 7 additions & 0 deletions go/vt/discovery/topology_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ func (tw *TopologyWatcher) loadTablets() {
defer tw.mu.Unlock()

for _, tInfo := range tabletInfos {
log.Infof("Got tabletInfo for %+v, isInServingGraph is %v", tInfo, tInfo.IsInServingGraph())
aliasStr := topoproto.TabletAliasString(tInfo.Alias)
tabletAliasStrs = append(tabletAliasStrs, aliasStr)

if !tw.refreshKnownTablets {
// We already have a tabletInfo for this and the flag tells us to not refresh.
if val, ok := tw.tablets[aliasStr]; ok {
newTablets[aliasStr] = val
log.Infof("Tablet Info already known and not refreshing for %+v", *tInfo)
continue
}
}
Expand All @@ -192,24 +194,29 @@ func (tw *TopologyWatcher) loadTablets() {
}
}

log.Infof("New tablets %+v", newTablets)
for alias, newVal := range newTablets {
if tw.tabletFilter != nil && !tw.tabletFilter.IsIncluded(newVal.tablet) {
log.Infof("Tablet %s filtered out", alias)
continue
}

// Trust the alias from topo and add it if it doesn't exist.
if val, ok := tw.tablets[alias]; ok {
log.Infof("Tablet %s already in tw.tablets", alias)
// check if the host and port have changed. If yes, replace tablet.
oldKey := TabletToMapKey(val.tablet)
newKey := TabletToMapKey(newVal.tablet)
if oldKey != newKey {
log.Infof("Tablet key mismatch: old %s new %s, replacing in healthcheck", oldKey, newKey)
// This is the case where the same tablet alias is now reporting
// a different address (host:port) key.
tw.healthcheck.ReplaceTablet(val.tablet, newVal.tablet)
topologyWatcherOperations.Add(topologyWatcherOpReplaceTablet, 1)
}
} else {
// This is a new tablet record, let's add it to the HealthCheck.
log.Infof("Tablet %s not in tw.tablets, adding to healthcheck", alias)
tw.healthcheck.AddTablet(newVal.tablet)
topologyWatcherOperations.Add(topologyWatcherOpAddTablet, 1)
}
Expand Down

0 comments on commit bc1d135

Please sign in to comment.