Browse Source

Match Go read_super_block: apply replication override from .vif

rust-volume-server
Chris Lu 3 days ago
parent
commit
7bf2595ea8
  1. 8
      seaweed-volume/src/storage/volume.rs

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

@ -912,6 +912,14 @@ impl Volume {
} }
self.super_block = SuperBlock::from_bytes(&full_buf)?; self.super_block = SuperBlock::from_bytes(&full_buf)?;
// 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;
}
}
Ok(()) Ok(())
} }

Loading…
Cancel
Save