From 672868b4603e91f4a6a24a08b9ac322c39888a19 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 28 Dec 2019 21:52:06 -0800 Subject: [PATCH] always create .vif file --- weed/storage/erasure_coding/ec_volume.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go index 3810cb0a5..579f037fb 100644 --- a/weed/storage/erasure_coding/ec_volume.go +++ b/weed/storage/erasure_coding/ec_volume.go @@ -11,6 +11,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb" "github.com/chrislusf/seaweedfs/weed/pb/master_pb" + "github.com/chrislusf/seaweedfs/weed/pb/volume_server_pb" "github.com/chrislusf/seaweedfs/weed/storage/idx" "github.com/chrislusf/seaweedfs/weed/storage/needle" "github.com/chrislusf/seaweedfs/weed/storage/types" @@ -61,6 +62,8 @@ func NewEcVolume(dir string, collection string, vid needle.VolumeId) (ev *EcVolu ev.Version = needle.Version3 if volumeInfo, found := pb.MaybeLoadVolumeInfo(baseFileName + ".vif"); found { ev.Version = needle.Version(volumeInfo.Version) + } else { + pb.SaveVolumeInfo(baseFileName+".vif", &volume_server_pb.VolumeInfo{Version: uint32(ev.Version)}) } ev.ShardLocations = make(map[ShardId][]string)