From bc1d135da2fce6391c4a617266b5d7d6042837d9 Mon Sep 17 00:00:00 2001 From: "Eduardo J. Ortega U." <5791035+ejortegau@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:46:14 +0100 Subject: [PATCH] Add logging to debug CI failures Signed-off-by: Eduardo J. Ortega U. <5791035+ejortegau@users.noreply.github.com> --- go/test/endtoend/cluster/cluster_process.go | 2 ++ go/vt/discovery/healthcheck.go | 3 ++- go/vt/discovery/topology_watcher.go | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/cluster/cluster_process.go b/go/test/endtoend/cluster/cluster_process.go index ed61f7fd0c9..61d7145db86 100644 --- a/go/test/endtoend/cluster/cluster_process.go +++ b/go/test/endtoend/cluster/cluster_process.go @@ -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 } } diff --git a/go/vt/discovery/healthcheck.go b/go/vt/discovery/healthcheck.go index 2f270bd7518..d8e16f03d81 100644 --- a/go/vt/discovery/healthcheck.go +++ b/go/vt/discovery/healthcheck.go @@ -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 } @@ -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() diff --git a/go/vt/discovery/topology_watcher.go b/go/vt/discovery/topology_watcher.go index d1e358e1aa5..8df02d4fc27 100644 --- a/go/vt/discovery/topology_watcher.go +++ b/go/vt/discovery/topology_watcher.go @@ -163,6 +163,7 @@ 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) @@ -170,6 +171,7 @@ func (tw *TopologyWatcher) loadTablets() { // 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 } } @@ -192,17 +194,21 @@ 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) @@ -210,6 +216,7 @@ func (tw *TopologyWatcher) loadTablets() { } } 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) }