Skip to content

Commit

Permalink
PT-2307 include last inactive check mesages on pt-galera-log-explainer
Browse files Browse the repository at this point in the history
  • Loading branch information
ylacancellera committed Jan 18, 2024
1 parent ad51e0c commit 7dfcbc1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/go/pt-galera-log-explainer/regex/views.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ var ViewsMap = types.RegexMap{
},
},

"RegexLastInactiveCheck": &types.LogRegex{
Regex: regexp.MustCompile("last inactive check more than"),
InternalRegex: regexp.MustCompile("last inactive check more than PT(?P<configuredValue>.*)S (\\(3\\*evs.inactive_check_period\\) )?ago \\(PT(?P<inactiveTime>.*)S\\),"),
Handler: func(submatches map[string]string, logCtx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {

return logCtx, types.SimpleDisplayer(utils.Paint(utils.YellowText, "inactive check more than "+submatches["configuredValue"]+"s ("+submatches["inactiveTime"]+"s)"))
},
},

"RegexWsrepUnsafeBootstrap": &types.LogRegex{
Regex: regexp.MustCompile("ERROR.*not be safe to bootstrap"),
Handler: func(submatches map[string]string, logCtx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {
Expand Down
12 changes: 12 additions & 0 deletions src/go/pt-galera-log-explainer/regex/views_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ func TestViewsRegex(t *testing.T) {
key: "RegexWsrepConsistenctyCompromised",
},

{
log: "2001-01-01T01:01:01.000000Z [Warning] WSREP: last inactive check more than PT1.5S (3*evs.inactive_check_period) ago (PT4.51947S), skipping check",
expectedOut: "inactive check more than 1.5s (4.51947s)",
key: "RegexLastInactiveCheck",
},
{
name: "mariadb variation",
log: "2001-01-01T01:01:01.000000Z [Warning] WSREP: last inactive check more than PT1.5S ago (PT4.51947S), skipping check",
expectedOut: "inactive check more than 1.5s (4.51947s)",
key: "RegexLastInactiveCheck",
},

{
log: "2001-01-01 5:06:12 47285568576576 [Note] WSREP: gcomm: bootstrapping new group 'cluster'",
expectedOut: "bootstrapping",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ mysql version 8.0.31 8.0.
2023-05-16T07:51:58.379294Z | recovering gcache |
2023-05-16T07:52:26.431252Z | CLOSED -> OPEN |
2023-05-16T07:52:26.431427Z | NON-PRIMARY(n=1) |
2023-05-16T07:52:26.931116Z | inactive check more than 1.5s (3.50171s) |
2023-05-16T10:03:18.655740Z starting(8.0.31) | |
2023-05-16T10:03:18.658268Z started(cluster) | |
2023-05-16T10:03:18.659239Z no grastate.dat file | |
Expand Down

0 comments on commit 7dfcbc1

Please sign in to comment.