Skip to content

Conversation

@tbg
Copy link
Member

@tbg tbg commented Jan 7, 2026

Backport 1/1 commits from #159888 on behalf of @tbg.


The test was failing because selectBestError in dist_sender.go can "flatten" an AmbiguousResultError by formatting it as a string via NewAmbiguousResultErrorf, which loses the error markers (ErrBreakerOpen and ReplicaUnavailableError types).

This change makes IsBreakerOpen fall back to string matching when the error is an AmbiguousResultError containing "replica unavailable" text, which is the distinctive marker from the stringified ReplicaUnavailableError.

A TODO comment is added suggesting the proper production fix would be to change selectBestError to wrap errors properly instead of formatting them as strings.

Fixes #159582

Release note: None


Release justification: fixes a flake.

The test was failing because selectBestError in dist_sender.go
can "flatten" an AmbiguousResultError by formatting it as a string
via NewAmbiguousResultErrorf, which loses the error markers
(ErrBreakerOpen and ReplicaUnavailableError types).

This change makes IsBreakerOpen fall back to string matching when
the error is an AmbiguousResultError containing "replica unavailable"
text, which is the distinctive marker from the stringified
ReplicaUnavailableError.

A TODO comment is added suggesting the proper production fix would be
to change selectBestError to wrap errors properly instead of formatting
them as strings.

Fixes cockroachdb#159582

Release note: None
@tbg tbg requested a review from a team as a code owner January 7, 2026 11:58
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Jan 7, 2026
@blathers-crl blathers-crl bot requested a review from stevendanna January 7, 2026 11:58
@blathers-crl
Copy link

blathers-crl bot commented Jan 7, 2026

Thanks for opening a backport.

Before merging, please confirm that the change does not break backwards compatibility and otherwise complies with the backport policy. Include a brief release justification in the PR description explaining why the backport is appropriate. All backports must be reviewed by the TL for the owning area. While the stricter LTS policy does not yet apply, please exercise judgment and consider gating non-critical changes behind a disabled-by-default feature flag when appropriate.

@blathers-crl blathers-crl bot added backport Label PR's that are backports to older release branches T-kv KV Team labels Jan 7, 2026
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@blathers-crl blathers-crl bot added the backport-test-only Used to denote the backport has only non-production changes label Jan 7, 2026
@tbg tbg merged commit 012ab05 into cockroachdb:release-26.1 Jan 7, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Label PR's that are backports to older release branches backport-test-only Used to denote the backport has only non-production changes blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. T-kv KV Team target-release-26.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants