mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-19 18:34:59 +00:00
pt-galera-log-explainer: fixed nitpicks from review
This commit is contained in:
@@ -70,10 +70,10 @@ func AddHashToIP(hash, ip string, ts time.Time) {
|
|||||||
db.rwlock.Lock()
|
db.rwlock.Lock()
|
||||||
defer db.rwlock.Unlock()
|
defer db.rwlock.Unlock()
|
||||||
latestValue, ok := db.HashToIP[hash]
|
latestValue, ok := db.HashToIP[hash]
|
||||||
if !ok || latestValue == nil {
|
if ok && latestValue != nil {
|
||||||
db.HashToIP[hash] = &translationUnit{Value: ip, Timestamp: ts}
|
|
||||||
} else {
|
|
||||||
latestValue.UpdateTimestamp(ts)
|
latestValue.UpdateTimestamp(ts)
|
||||||
|
} else {
|
||||||
|
db.HashToIP[hash] = &translationUnit{Value: ip, Timestamp: ts}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,6 +40,8 @@ func (w *whois) Run() error {
|
|||||||
case regex.IsNodeIP(w.Search):
|
case regex.IsNodeIP(w.Search):
|
||||||
w.SearchType = "ip"
|
w.SearchType = "ip"
|
||||||
case len(w.Search) != 8:
|
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"
|
w.SearchType = "nodename"
|
||||||
default:
|
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")
|
log.Info().Msg("input information's type is ambiguous, scanning files to discover the type. You can also provide --type to avoid auto-detection")
|
||||||
|
Reference in New Issue
Block a user