Skip to content

Commit

Permalink
sql: use a structured error to detect roachpb.BatchTimestampBeforeGCE…
Browse files Browse the repository at this point in the history
…rror

Fixes #50198.

See the issue for more details. This issue is so obscure it does not deserve
a release note.

Release note: None
  • Loading branch information
ajwerner committed Jul 28, 2020
1 parent 1e01cbe commit 27f8f1e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/sql/schema_changer.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,7 @@ func isPermanentSchemaChangeError(err error) bool {
// Ignore error thrown because of a read at a very old timestamp.
// The Backfill will grab a new timestamp to read at for the rest
// of the backfill.
// TODO(knz): this should really use errors.Is(). However until/unless
// we are not receiving errors from 19.1 any more, a string
// comparison must remain.
if strings.Contains(err.Error(), "must be after replica GC threshold") {
if errors.HasType(err, (*roachpb.BatchTimestampBeforeGCError)(nil)) {
return false
}

Expand Down

0 comments on commit 27f8f1e

Please sign in to comment.