From 2789b7c3dd12293edffcba5f227fbda1aba576c0 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Mar 2026 14:39:02 -0700 Subject: [PATCH] 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. --- seaweed-volume/src/storage/volume.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/seaweed-volume/src/storage/volume.rs b/seaweed-volume/src/storage/volume.rs index 57f36d8f3..94d42c853 100644 --- a/seaweed-volume/src/storage/volume.rs +++ b/seaweed-volume/src/storage/volume.rs @@ -951,9 +951,8 @@ impl Volume { // Match Go: if volumeInfo.Replication is set, override super block's ReplicaPlacement 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(())