mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
always create .vif file
This commit is contained in:
parent
03ab0b1b9a
commit
672868b460
|
@ -11,6 +11,7 @@ import (
|
||||||
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb"
|
"github.com/chrislusf/seaweedfs/weed/pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/master_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/idx"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
"github.com/chrislusf/seaweedfs/weed/storage/needle"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage/types"
|
"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
|
ev.Version = needle.Version3
|
||||||
if volumeInfo, found := pb.MaybeLoadVolumeInfo(baseFileName + ".vif"); found {
|
if volumeInfo, found := pb.MaybeLoadVolumeInfo(baseFileName + ".vif"); found {
|
||||||
ev.Version = needle.Version(volumeInfo.Version)
|
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)
|
ev.ShardLocations = make(map[ShardId][]string)
|
||||||
|
|
Loading…
Reference in a new issue