Skip to content

Commit

Permalink
Merge pull request #104246 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.1-104128
  • Loading branch information
tbg authored Jun 26, 2023
2 parents dbf6ce8 + e32b529 commit bcbc49f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/util/startup/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ go_library(
visibility = ["//visibility:public"],
deps = [
"//pkg/kv/kvpb",
"//pkg/sql/pgwire/pgcode",
"//pkg/sql/pgwire/pgerror",
"//pkg/util",
"//pkg/util/log",
"//pkg/util/retry",
Expand Down
7 changes: 6 additions & 1 deletion pkg/util/startup/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ import (
"time"

"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode"
"github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror"
"github.com/cockroachdb/cockroach/pkg/util"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/retry"
Expand Down Expand Up @@ -206,5 +208,8 @@ func inStartup() bool {

// IsRetryableReplicaError returns true for replica availability errors.
func IsRetryableReplicaError(err error) bool {
return errors.HasType(err, (*kvpb.ReplicaUnavailableError)(nil)) || errors.HasType(err, (*kvpb.AmbiguousResultError)(nil))
return errors.HasType(err, (*kvpb.ReplicaUnavailableError)(nil)) ||
errors.HasType(err, (*kvpb.AmbiguousResultError)(nil)) ||
// See https://github.com/cockroachdb/cockroach/issues/104016#issuecomment-1569719273.
pgerror.GetPGCode(err) == pgcode.RangeUnavailable
}

0 comments on commit bcbc49f

Please sign in to comment.