diff --git a/src/go/pt-galera-log-explainer/translate/translate.go b/src/go/pt-galera-log-explainer/translate/translate.go index 12ad5371..f7c13dc9 100644 --- a/src/go/pt-galera-log-explainer/translate/translate.go +++ b/src/go/pt-galera-log-explainer/translate/translate.go @@ -70,10 +70,10 @@ func AddHashToIP(hash, ip string, ts time.Time) { db.rwlock.Lock() defer db.rwlock.Unlock() latestValue, ok := db.HashToIP[hash] - if !ok || latestValue == nil { - db.HashToIP[hash] = &translationUnit{Value: ip, Timestamp: ts} - } else { + if ok && latestValue != nil { latestValue.UpdateTimestamp(ts) + } else { + db.HashToIP[hash] = &translationUnit{Value: ip, Timestamp: ts} } } diff --git a/src/go/pt-galera-log-explainer/whois.go b/src/go/pt-galera-log-explainer/whois.go index e0e0e26b..d00a76cd 100644 --- a/src/go/pt-galera-log-explainer/whois.go +++ b/src/go/pt-galera-log-explainer/whois.go @@ -40,6 +40,8 @@ func (w *whois) Run() error { case regex.IsNodeIP(w.Search): w.SearchType = "ip" case len(w.Search) != 8: + // at this point it's only a doubt between names and legacy node uuid, where only the first part of the uuid was shown in log + // legacy UUIDs were 8 characters long, so anything else has to be nodename w.SearchType = "nodename" default: log.Info().Msg("input information's type is ambiguous, scanning files to discover the type. You can also provide --type to avoid auto-detection")