Browse Source

fix VolumeTierMoveDatFromRemote to close remote dat backend after download

Go calls v.DataBackend.Close() and sets DataBackend=nil after removing
the remote file reference. Without this, the stale remote backend
state lingers and reads may not discover the newly downloaded local
.dat file until server restart.
rust-volume-server
Chris Lu 2 days ago
parent
commit
f2cc866ce4
  1. 4
      seaweed-volume/src/server/grpc_server.rs
  2. 6
      seaweed-volume/src/storage/volume.rs

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

@ -3029,6 +3029,10 @@ impl VolumeServer for VolumeGrpcService {
vid, e
)));
}
// Close old remote backend (matches Go: v.DataBackend.Close(); v.DataBackend = nil)
// This forces the next read to discover and open the local .dat file.
vol.close_remote_dat_backend();
}
}
}

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

@ -2090,6 +2090,12 @@ impl Volume {
self.dat_file = None;
}
/// Close the remote dat file backend (matches Go's v.DataBackend.Close(); v.DataBackend = nil).
/// Called after tier-download when the remote backend is being replaced by local storage.
pub fn close_remote_dat_backend(&mut self) {
self.remote_dat_file = None;
}
/// Path to .vif file.
fn vif_path(&self) -> String {
format!("{}.vif", self.data_file_name())

Loading…
Cancel
Save