mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 21:51:21 +00:00
Merge pull request #750 from ylacancellera/PT-2298_pt-galera-log-explainer_superfluous_lines_on_conflicts
PT-2298 pt-galera-log-explainer superfluous lines on conflicts
This commit is contained in:
@@ -103,6 +103,12 @@ func TestMain(t *testing.T) {
|
|||||||
cmd: []string{"conflicts"},
|
cmd: []string{"conflicts"},
|
||||||
path: "tests/logs/conflict/*",
|
path: "tests/logs/conflict/*",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "conflict_list_all_no_color",
|
||||||
|
cmd: []string{"list", "--all", "--no-color"},
|
||||||
|
path: "tests/logs/conflict/*",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
TESTS:
|
TESTS:
|
||||||
|
@@ -92,14 +92,17 @@ var ApplicativeMap = types.RegexMap{
|
|||||||
|
|
||||||
return logCtx, func(logCtx types.LogCtx) string {
|
return logCtx, func(logCtx types.LogCtx) string {
|
||||||
|
|
||||||
for _, name := range logCtx.OwnNames {
|
for _, localname := range logCtx.OwnNames {
|
||||||
vote, ok := latestConflict.VotePerNode[name]
|
if node != localname {
|
||||||
if !ok {
|
// don't print other nodes vote, their should be in their own column
|
||||||
|
// else it just takes too much place without adding much usability
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if vote, ok := latestConflict.VotePerNode[localname]; ok {
|
||||||
return voteResponse(vote, *latestConflict)
|
return voteResponse(vote, *latestConflict)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@@ -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
|
@@ -139,7 +139,7 @@ func getlasttime(l LocalTimeline) time.Time {
|
|||||||
func CutTimelineAt(t LocalTimeline, at time.Time) LocalTimeline {
|
func CutTimelineAt(t LocalTimeline, at time.Time) LocalTimeline {
|
||||||
var i int
|
var i int
|
||||||
for i = 0; i < len(t); i++ {
|
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
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user