Fix: typos

This commit is contained in:
Yoann La Cancellera
2023-11-21 15:57:15 +01:00
committed by Sveta Smirnova
parent 7876a0511c
commit 3fae43123e
10 changed files with 24 additions and 24 deletions

View File

@@ -46,7 +46,7 @@ var PXCOperatorMap = types.RegexMap{
// it could have been useful as an "verbosity=types.Detailed" regexes, very rarely
// but in context of operators, it is actually a very important information
"RegexGcacheScan": &types.LogRegex{
// those "operators" regexes do not have the log prefix added implicitely. It's not strictly needed, but
// those "operators" regexes do not have the log prefix added implicitly. It's not strictly needed, but
// it will help to avoid catching random piece of log out of order
Regex: regexp.MustCompile(k8sprefix + ".*GCache::RingBuffer initial scan"),
Handler: func(submatches map[string]string, ctx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {
@@ -59,7 +59,7 @@ var PXCOperatorMap = types.RegexMap{
// so this regex is about capturing subgroups to re-handle each them to the appropriate existing IdentsMap regex
"RegexOperatorMemberAssociations": &types.LogRegex{
Regex: regexp.MustCompile("================================================.*View:"),
InternalRegex: regexp.MustCompile("own_index: " + regexIdx + ".*(?P<memberlog>" + IdentsMap["RegexMemberCount"].Regex.String() + ")(?P<compiledAssocations>(....-?[0-9]{1,2}(\\.-?[0-9])?: [a-z0-9]+-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]+, [a-zA-Z0-9-_\\.]+)+)"),
InternalRegex: regexp.MustCompile("own_index: " + regexIdx + ".*(?P<memberlog>" + IdentsMap["RegexMemberCount"].Regex.String() + ")(?P<compiledAssociations>(....-?[0-9]{1,2}(\\.-?[0-9])?: [a-z0-9]+-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]+, [a-zA-Z0-9-_\\.]+)+)"),
Handler: func(submatches map[string]string, ctx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {
ctx.MyIdx = submatches[groupIdx]
@@ -72,13 +72,13 @@ var PXCOperatorMap = types.RegexMap{
ctx, displayer = IdentsMap["RegexMemberCount"].Handle(ctx, submatches["memberlog"], date)
msg += displayer(ctx) + "; "
subAssociations := strings.Split(submatches["compiledAssocations"], "\\n\\t")
subAssociations := strings.Split(submatches["compiledAssociations"], "\\n\\t")
if len(subAssociations) < 2 {
return ctx, types.SimpleDisplayer(msg)
}
for _, subAssocation := range subAssociations[1:] {
for _, subAssociation := range subAssociations[1:] {
// better to reuse the idents regex
ctx, displayer = IdentsMap["RegexMemberAssociations"].Handle(ctx, subAssocation, date)
ctx, displayer = IdentsMap["RegexMemberAssociations"].Handle(ctx, subAssociation, date)
msg += displayer(ctx) + "; "
}
return ctx, types.SimpleDisplayer(msg)

View File

@@ -273,7 +273,7 @@ var SSTMap = types.RegexMap{
},
"RegexTimeoutReceivingFirstData": &types.LogRegex{
Regex: regexp.MustCompile("Possible timeout in receving first data from donor in gtid/keyring stage"),
Regex: regexp.MustCompile("Possible timeout in receving first data from donor in gtid/keyring stage"), // typo is in Galera lib
Handler: func(submatches map[string]string, ctx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {
return ctx, types.SimpleDisplayer(utils.Paint(utils.RedText, "timeout from donor in gtid/keyring stage"))
},

View File

@@ -147,7 +147,7 @@ var ViewsMap = types.RegexMap{
},
},
"RegexSafeToBoostrapSet": &types.LogRegex{
"RegexSafeToBootstrapSet": &types.LogRegex{
Regex: regexp.MustCompile("safe_to_bootstrap: 1"),
Handler: func(submatches map[string]string, ctx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {
return ctx, types.SimpleDisplayer(utils.Paint(utils.YellowText, "safe_to_bootstrap: 1"))
@@ -159,8 +159,8 @@ var ViewsMap = types.RegexMap{
return ctx, types.SimpleDisplayer(utils.Paint(utils.YellowText, "no grastate.dat file"))
},
},
"RegexBootstrapingDefaultState": &types.LogRegex{
Regex: regexp.MustCompile("Bootstraping with default state"),
"RegexBootstrappingDefaultState": &types.LogRegex{
Regex: regexp.MustCompile("Bootstraping with default state"), // typo is in Galera lib
Handler: func(submatches map[string]string, ctx types.LogCtx, log string, date time.Time) (types.LogCtx, types.LogDisplayer) {
return ctx, types.SimpleDisplayer(utils.Paint(utils.YellowText, "bootstrapping(empty grastate)"))
},

View File

@@ -200,13 +200,13 @@ func TestViewsRegex(t *testing.T) {
{
log: "2001-01-01T01:01:01.000000Z 0 [Note] WSREP: Found saved state: 8e862473-455e-11e8-a0ca-3fcd8faf3209:-1, safe_to_bootstrap: 1",
expectedOut: "safe_to_bootstrap: 1",
key: "RegexSafeToBoostrapSet",
key: "RegexSafeToBootstrapSet",
},
{
name: "should not match",
log: "2001-01-01T01:01:01.000000Z 0 [Note] WSREP: Found saved state: 8e862473-455e-11e8-a0ca-3fcd8faf3209:-1, safe_to_bootstrap: 0",
expectedErr: true,
key: "RegexSafeToBoostrapSet",
key: "RegexSafeToBootstrapSet",
},
{
@@ -218,7 +218,7 @@ func TestViewsRegex(t *testing.T) {
{
log: "2001-01-01T01:01:01.000000Z 0 [Warning] [MY-000000] [Galera] No persistent state found. Bootstraping with default state",
expectedOut: "bootstrapping(empty grastate)",
key: "RegexBootstrapingDefaultState",
key: "RegexBootstrappingDefaultState",
},
}