Skip to content

Commit

Permalink
workload/scheamchanger: fix unknown schema retry detection
Browse files Browse the repository at this point in the history
Fixes: #89146

Previously, when we added logic to retry unknown schema errors,
the regex used was unfortunately out of sync with the actual
error generated. This patch fixes the regex to have the correct
string, since those errors were not properly retried.

Release note: None
  • Loading branch information
fqazi committed Oct 12, 2022
1 parent 9c7e74f commit d603550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/workload/schemachange/error_screening.go
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,9 @@ SELECT count(*) FROM %s
}

var (
regexpUnknownSchemaErr = regexp.MustCompile(`unknown schema \[\d+\]`)
// regexpUnknownSchemaErr matches unknown schema errors with
// a descriptor ID, which will have the form: unknown schema "[123]"
regexpUnknownSchemaErr = regexp.MustCompile(`unknown schema "\[\d+]"`)
)

// checkAndAdjustForUnknownSchemaErrors in certain contexts we will attempt to
Expand All @@ -1135,7 +1137,7 @@ func (og *operationGenerator) checkAndAdjustForUnknownSchemaErrors(err error) er
if regexpUnknownSchemaErr.MatchString(pgErr.Message) {
og.opGenLog.WriteString(fmt.Sprintf("Rolling back due to unknown schema error %v",
err))
// Force a rollback and log inside the oepration generator.
// Force a rollback and log inside the operation generator.
return errors.Mark(err, errRunInTxnRbkSentinel)
}
}
Expand Down

0 comments on commit d603550

Please sign in to comment.