From 5ece8dd63c3808eae52e6e87388d45ad1f0f92bd Mon Sep 17 00:00:00 2001 From: Eliah Rusin Date: Thu, 1 Oct 2026 15:13:45 +0300 Subject: [PATCH] volume server: drop the unused unmount result in VolumeCopy validation, and test-only EC helpers (#11531) mount_and_reply ignored the Result of store.unmount_volume when a copied replica failed record count validation, tripping unused_must_use. The Err branch is unreachable there: the volume was mounted under the same store write guard, mount_volume refuses an already loaded vid so it is a fresh Volume with is_compacting false, and a compaction claim needs &mut Volume, i.e. the store lock. Ignore the result explicitly with a one-line reason. Store::delete_expired_ec_volumes and Store::remove_ec_volume are called only from test modules (the heartbeat uses the split find_expired_ec_volumes / remove_expired_ec_volumes halves), so mark them #[cfg(test)]. Co-authored-by: Claude Opus 5.5 (1M context) --- seaweed-volume/src/server/grpc_server.rs | 3 ++- seaweed-volume/src/storage/store.rs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/seaweed-volume/src/server/grpc_server.rs b/seaweed-volume/src/server/grpc_server.rs index 7d36c0443..1e98ec462 100644 --- a/seaweed-volume/src/server/grpc_server.rs +++ b/seaweed-volume/src/server/grpc_server.rs @@ -5683,7 +5683,8 @@ impl VolumeCopyJob { v.deleted_count() as u64, ) { - store.unmount_volume(vid); + // Cannot fail: mounted under this same guard, so it cannot be compacting. + let _ = store.unmount_volume(vid); return Err(Status::internal(format!( "failed to mount or validate volume {}: {}", vid, e diff --git a/seaweed-volume/src/storage/store.rs b/seaweed-volume/src/storage/store.rs index 29d254aa9..8be0fa6b8 100644 --- a/seaweed-volume/src/storage/store.rs +++ b/seaweed-volume/src/storage/store.rs @@ -1216,6 +1216,7 @@ impl Store { found_vol.map(|v| (v, dirs)) } + #[cfg(test)] pub fn delete_expired_ec_volumes( &mut self, ) -> ( @@ -1301,6 +1302,7 @@ impl Store { } /// Remove an EC volume from whichever location has it. + #[cfg(test)] pub fn remove_ec_volume(&mut self, vid: VolumeId) -> Option { for loc in &mut self.locations { if let Some(ecv) = loc.remove_ec_volume(vid) {