mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-05 22:12:04 +02:00
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) <noreply@anthropic.com>
This commit is contained in:
1 parent
67f7fad987
commit
5ece8dd63c
2 files changed
+4
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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<EcVolume> {
|
||||
for loc in &mut self.locations {
|
||||
if let Some(ecv) = loc.remove_ec_volume(vid) {
|
||||
|
||||
Reference in new issue
Block a user