cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.16k stars 3.82k forks source link

row: mark an error from streamer as StorageError #135859

Open yuzefovich opened 1 day ago

yuzefovich commented 1 day ago

Earlier this year we changed the vectorized panic-catcher, namely, we now check a few special error types (like StorageError, notInternalError, and internalError upfront - to avoid more expensive stack-based checks). If we find an internalError and it doesn't have a PG code and doesn't have StorageError or notInternalError in the causes, we now always mark the error as assertion failure. This made it so that we started receiving more sentry reports than previously; in particular, whenever we're using the streamer API, we could now get stop.ErrUnavailable via the following sequence of calls ColIndexJoin.Next -> cFetcher.StartScan -> txnKVStreamer.SetupNextFetch -> Streamer.Enqueue, and this would trigger a sentry report. This commit fixes this by marking an error coming from Streamer.Enqueue as StorageError which will by-pass the logic in the panic-catcher.

Fixes: #128649.

Release note: None

blathers-crl[bot] commented 1 day ago

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

cockroach-teamcity commented 1 day ago

This change is Reviewable