mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
volume(rs): report a volume a collection delete could not destroy
The collection delete logged a refused destroy, kept the volume mounted and still answered success, so the caller never retried. Return the first error after the loop, as the Go store does, while the other volumes of the collection are still deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0589a59bf8
commit
0709c04af3
1 file changed
+3
-1
@@ -782,6 +782,7 @@ impl DiskLocation {
|
||||
|
||||
/// Delete all volumes in a collection.
|
||||
pub fn delete_collection(&mut self, collection: &str) -> Result<(), VolumeError> {
|
||||
let mut first_error = None;
|
||||
let vids: Vec<VolumeId> = self
|
||||
.volumes
|
||||
.iter()
|
||||
@@ -793,6 +794,7 @@ impl DiskLocation {
|
||||
if let Some(v) = self.volumes.remove(&vid) {
|
||||
if let Err(e) = v.destroy(false, false, false) {
|
||||
warn!(volume_id = vid.0, error = %e, "delete collection: failed to destroy volume");
|
||||
first_error.get_or_insert(e);
|
||||
self.volumes.insert(vid, v);
|
||||
} else {
|
||||
crate::metrics::VOLUME_GAUGE
|
||||
@@ -819,7 +821,7 @@ impl DiskLocation {
|
||||
ec_vol.destroy();
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
first_error.map_or(Ok(()), Err)
|
||||
}
|
||||
|
||||
// ---- Metrics ----
|
||||
|
||||
Reference in new issue
Block a user