Skip to content

Commit 841517e

Browse files
authored
fix(pageserver): do not increase basebackup err counter when reconnect (neondatabase#12016)
## Problem We see unexpected basebackup error alerts in the alert channel. neondatabase#11778 only fixed the alerts for shutdown errors. However, another path is that tenant shutting down while waiting LSN -> WaitLsnError::BadState -> QueryError::Reconnect. Therefore, the reconnect error should also be discarded from the ok/error counter. ## Summary of changes Do not increase ok/err counter for reconnect errors. --------- Signed-off-by: Alex Chi Z <[email protected]>
1 parent 1369d73 commit 841517e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pageserver/src/metrics.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,8 +2234,10 @@ impl BasebackupQueryTimeOngoingRecording<'_> {
22342234
// If you want to change categorize of a specific error, also change it in `log_query_error`.
22352235
let metric = match res {
22362236
Ok(_) => &self.parent.ok,
2237-
Err(QueryError::Shutdown) => {
2238-
// Do not observe ok/err for shutdown
2237+
Err(QueryError::Shutdown) | Err(QueryError::Reconnect) => {
2238+
// Do not observe ok/err for shutdown/reconnect.
2239+
// Reconnect error might be raised when the operation is waiting for LSN and the tenant shutdown interrupts
2240+
// the operation. A reconnect error will be issued and the client will retry.
22392241
return;
22402242
}
22412243
Err(QueryError::Disconnected(ConnectionError::Io(io_error)))

0 commit comments

Comments
 (0)