PT-2298 pt-galera-log-explainer superfluous lines on conflicts

This commit is contained in:
Yoann La Cancellera
2024-01-08 18:37:57 +01:00
parent 8521dd0c3c
commit 97cc3ebb01
4 changed files with 24 additions and 4 deletions

View File

@@ -103,6 +103,12 @@ func TestMain(t *testing.T) {
cmd: []string{"conflicts"},
path: "tests/logs/conflict/*",
},
{
name: "conflict_list_all_no_color",
cmd: []string{"list", "--all", "--no-color"},
path: "tests/logs/conflict/*",
},
}
TESTS:

View File

@@ -92,9 +92,11 @@ var ApplicativeMap = types.RegexMap{
return logCtx, func(logCtx types.LogCtx) string {
for _, name := range logCtx.OwnNames {
vote, ok := latestConflict.VotePerNode[name]
if !ok {
for _, localname := range logCtx.OwnNames {
vote, ok := latestConflict.VotePerNode[localname]
// don't print other nodes vote, their should be in their own column
// else it just takes too much place without adding much usability
if node != localname || !ok {
continue
}

View File

@@ -0,0 +1,12 @@
identifier node1
current path tests/logs/conflict/node.log
last known ip
last known name node1
mysql version
2023-10-21T04:01:01.700706Z inconsistency vote started(seqno:102573168)
consistency vote(seqno:102573168): lost
2023-10-21T04:01:01.701512Z found inconsistent by vote
2023-10-21T04:01:01.704318Z NON-PRIMARY(n=1)
2023-10-21T04:01:01.704384Z SYNCED -> OPEN
2023-10-21T04:01:01.704465Z OPEN -> CLOSED

View File

@@ -139,7 +139,7 @@ func getlasttime(l LocalTimeline) time.Time {
func CutTimelineAt(t LocalTimeline, at time.Time) LocalTimeline {
var i int
for i = 0; i < len(t); i++ {
if t[i].Date.Time.After(at) {
if t[i].Date != nil && t[i].Date.Time.After(at) {
break
}
}