SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
add vif file versions in case loading superblock fails
Chris Lu015d16f43f1f
diff --git a/weed/storage/volume_loading.go b/weed/storage/volume_loading.goindex bff1055bbe..cf34ff1339 100644--- a/weed/storage/volume_loading.go+++ b/weed/storage/volume_loading.go@@ -39,12 +39,12 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind}}()- hasVolumeInfoFile := v.maybeLoadVolumeInfo() && v.volumeInfo.Version != 0+ hasVolumeInfoFile := v.maybeLoadVolumeInfo()if v.HasRemoteFile() {v.noWriteCanDelete = truev.noWriteOrDelete = false- glog.V(0).Infof("loading volume %d from remote %v", v.Id, v.volumeInfo.Files)+ glog.V(0).Infof("loading volume %d from remote %v", v.Id, v.volumeInfo)v.LoadRemoteFile()alreadyHasSuperBlock = true} else if exists, canRead, canWrite, modifiedTime, fileSize := util.CheckFile(v.FileName(".dat")); exists {diff --git a/weed/storage/volume_tier.go b/weed/storage/volume_tier.goindex 77efd8a140..da93221b2f 100644--- a/weed/storage/volume_tier.go+++ b/weed/storage/volume_tier.go@@ -6,6 +6,7 @@ import ("github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb""github.com/chrislusf/seaweedfs/weed/storage/backend"_ "github.com/chrislusf/seaweedfs/weed/storage/backend/s3_backend"+ "github.com/chrislusf/seaweedfs/weed/storage/needle")func (v *Volume) GetVolumeInfo() *volume_server_pb.VolumeInfo {@@ -14,14 +15,24 @@ func (v *Volume) GetVolumeInfo() *volume_server_pb.VolumeInfo {func (v *Volume) maybeLoadVolumeInfo() (found bool) {- v.volumeInfo, v.hasRemoteFile, _ = pb.MaybeLoadVolumeInfo(v.FileName(".vif"))+ var err error+ v.volumeInfo, v.hasRemoteFile, err = pb.MaybeLoadVolumeInfo(v.FileName(".vif"))++ if v.volumeInfo.Version == 0 {+ v.volumeInfo.Version = uint32(needle.CurrentVersion)+ }if v.hasRemoteFile {glog.V(0).Infof("volume %d is tiered to %s as %s and read only", v.Id,v.volumeInfo.Files[0].BackendName(), v.volumeInfo.Files[0].Key)}- return+ if err != nil {+ glog.Warningf("load volume %d.vif file: %v", v.Id, err)+ return false+ }++ return true}