This commit is contained in:
chrislu 2024-08-13 13:59:24 -07:00
parent 07f4998188
commit fdf7193ae7
4 changed files with 500 additions and 500 deletions

View File

@ -478,7 +478,7 @@ message VolumeInfo {
uint32 version = 2;
string replication = 3;
uint32 BytesOffset = 4;
int64 file_size = 5; // used for EC encoded volumes to store the original file size
int64 dat_file_size = 5; // used for EC encoded volumes to store the original file size
}
// tiered storage

File diff suppressed because it is too large Load Diff

View File

@ -74,7 +74,7 @@ func (vs *VolumeServer) VolumeEcShardsGenerate(ctx context.Context, req *volume_
datSize, _, _ := v.FileStat()
if err := volume_info.SaveVolumeInfo(baseFileName+".vif", &volume_server_pb.VolumeInfo{
Version: uint32(v.Version()),
FileSize: int64(datSize),
DatFileSize: int64(datSize),
}); err != nil {
return nil, fmt.Errorf("SaveVolumeInfo %s: %v", baseFileName, err)
}

View File

@ -69,7 +69,7 @@ func NewEcVolume(diskType types.DiskType, dir string, dirIdx string, collection
ev.Version = needle.Version3
if volumeInfo, _, found, _ := volume_info.MaybeLoadVolumeInfo(dataBaseFileName + ".vif"); found {
ev.Version = needle.Version(volumeInfo.Version)
ev.datFileSize = volumeInfo.FileSize
ev.datFileSize = volumeInfo.DatFileSize
} else {
volume_info.SaveVolumeInfo(dataBaseFileName+".vif", &volume_server_pb.VolumeInfo{Version: uint32(ev.Version)})
}