From 913f7754bbefa2899056b1af83d7789b01a4ba39 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 28 Mar 2022 15:47:23 +0200 Subject: [PATCH] Add blocks in errored state to `garage stats` --- src/block/manager.rs | 5 +++++ src/garage/admin.rs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/block/manager.rs b/src/block/manager.rs index 9cf72019..a3c4ec0d 100644 --- a/src/block/manager.rs +++ b/src/block/manager.rs @@ -265,6 +265,11 @@ impl BlockManager { self.resync_queue.len() } + /// Get number of blocks that have an error + pub fn resync_errors_len(&self) -> usize { + self.resync_errors.len() + } + /// Get number of items in the refcount table pub fn rc_len(&self) -> usize { self.rc.rc.len() diff --git a/src/garage/admin.rs b/src/garage/admin.rs index f9ec1593..0b20bb20 100644 --- a/src/garage/admin.rs +++ b/src/garage/admin.rs @@ -728,6 +728,12 @@ impl AdminRpcHandler { self.garage.block_manager.resync_queue_len() ) .unwrap(); + writeln!( + &mut ret, + " blocks with resync errors: {}", + self.garage.block_manager.resync_errors_len() + ) + .unwrap(); ret }