mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-13 08:22:55 +00:00
There are a couple of places that call CompactionError::is_cancel but don't check the Other variant for root cause. But they should, because some cancellations are observed by code that results in ::Other errors. I don't think there's a _serious_ case where this causes problems. The worst case one is the circuit breaker which we do currently trip on ::Other errors that are due to cancellation. Tripped circuit breaker on shutting down timelines doesn't really matter practically, but it's unaesthetic and might cause noise down the line, so, this PR fixes that at least. In any way, this PR forces future callers of is_cancel() to explicitly recognize the suboptimal state of affairs wrt error handling in compaction, thereby hopefully preventing errors of this kind from creeping in. (The _right_ solution for the compaction code probably is the approach I took in #11853: keep using anyhow but have a unified way / pattern of bubbling up cancellation, so that we don't need to perform the downcast trickery).