Browse Source

Match Go readSuperBlock: propagate replication parse errors

Go returns an error when parsing the replication string from the .vif
file fails. Rust was silently ignoring the parse failure and using the
super block's replication as-is.
rust-volume-server
Chris Lu 3 days ago
parent
commit
2789b7c3dd
  1. 5
      seaweed-volume/src/storage/volume.rs

5
seaweed-volume/src/storage/volume.rs

@ -951,9 +951,8 @@ impl Volume {
// Match Go: if volumeInfo.Replication is set, override super block's ReplicaPlacement // Match Go: if volumeInfo.Replication is set, override super block's ReplicaPlacement
if !self.volume_info.replication.is_empty() { if !self.volume_info.replication.is_empty() {
if let Ok(rp) = ReplicaPlacement::from_string(&self.volume_info.replication) {
self.super_block.replica_placement = rp;
}
let rp = ReplicaPlacement::from_string(&self.volume_info.replication)?;
self.super_block.replica_placement = rp;
} }
Ok(()) Ok(())

Loading…
Cancel
Save