Skip to content

Commit

Permalink
pgcode: remove a couple of deprecated errors
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
yuzefovich committed Apr 27, 2021
1 parent 0312ae6 commit a99064b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions pkg/sql/pgwire/pgcode/codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,8 @@ var (
// RangeUnavailable signals that some data from the cluster cannot be
// accessed (e.g. because all replicas awol).
RangeUnavailable = MakeCode("58C00")
// DeprecatedRangeUnavailable is code that we used for RangeUnavailable until 19.2.
// 20.1 needs to recognize it coming from 19.2 nodes.
// TODO(andrei): remove in 20.2.
DeprecatedRangeUnavailable = MakeCode("XXC00")

// InternalConnectionFailure refers to a networking error encountered
// internally on a connection between different Cockroach nodes.
InternalConnectionFailure = MakeCode("58C01")
// DeprecatedInternalConnectionFailure is code that we used for
// InternalConnectionFailure until 19.2.
// 20.1 needs to recognize it coming from 19.2 nodes.
// TODO(andrei): remove in 20.2.
DeprecatedInternalConnectionFailure = ConnectionFailure
)
4 changes: 2 additions & 2 deletions pkg/sql/schema_changer.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ func isPermanentSchemaChangeError(err error) bool {
}

switch pgerror.GetPGCode(err) {
case pgcode.SerializationFailure, pgcode.InternalConnectionFailure, pgcode.DeprecatedInternalConnectionFailure:
case pgcode.SerializationFailure, pgcode.InternalConnectionFailure:
return false

case pgcode.Internal, pgcode.RangeUnavailable, pgcode.DeprecatedRangeUnavailable:
case pgcode.Internal, pgcode.RangeUnavailable:
if strings.Contains(err.Error(), context.DeadlineExceeded.Error()) {
return false
}
Expand Down

0 comments on commit a99064b

Please sign in to comment.