Browse Source

Match Go VolumeEcShardsCopy: append to .ecj file instead of truncating

rust-volume-server
Chris Lu 3 days ago
parent
commit
10f99fdfd2
  1. 5
      seaweed-volume/src/server/grpc_server.rs

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

@ -2247,7 +2247,10 @@ impl VolumeServer for VolumeGrpcService {
crate::storage::volume::volume_file_name(&dest_idx_dir, &req.collection, vid);
format!("{}.ecj", base)
};
let mut file = std::fs::File::create(&file_path)
let mut file = std::fs::OpenOptions::new()
.create(true)
.append(true)
.open(&file_path)
.map_err(|e| Status::internal(format!("create {}: {}", file_path, e)))?;
while let Some(chunk) = stream
.message()

Loading…
Cancel
Save