Browse Source

Match Go VolumeCopy: reject when no suitable disk location exists

Go returns ErrVolumeNoSpaceLeft when no location matches the disk type
and has sufficient space. Rust had an unsafe fallback that silently
picked the first location regardless of type or available space.
rust-volume-server
Chris Lu 3 days ago
parent
commit
119192ca75
  1. 5
      seaweed-volume/src/server/grpc_server.rs

5
seaweed-volume/src/server/grpc_server.rs

@ -944,11 +944,6 @@ impl VolumeServer for VolumeGrpcService {
}
}
}
// Fallback: use first location if no disk type match
if found.is_none() && !store.locations.is_empty() {
let loc = &store.locations[0];
found = Some((loc.directory.clone(), loc.idx_directory.clone()));
}
found.ok_or_else(|| Status::internal(format!("no space left {}", disk_type)))?
};

Loading…
Cancel
Save