mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 00:43:32 +08:00
fix for spreading ec shards
This commit is contained in:
@@ -143,10 +143,17 @@ func (vs *VolumeServer) VolumeEcShardsCopy(ctx context.Context, req *volume_serv
|
|||||||
|
|
||||||
glog.V(0).Infof("VolumeEcShardsCopy: %v", req)
|
glog.V(0).Infof("VolumeEcShardsCopy: %v", req)
|
||||||
|
|
||||||
location := vs.store.FindFreeLocation(func(location *storage.DiskLocation) bool {
|
var location *storage.DiskLocation
|
||||||
_, found := location.FindEcVolume(needle.VolumeId(req.VolumeId))
|
if req.CopyEcxFile {
|
||||||
return found
|
location = vs.store.FindFreeLocation(func(location *storage.DiskLocation) bool {
|
||||||
})
|
return location.DiskType == types.HardDriveType
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
location = vs.store.FindFreeLocation(func(location *storage.DiskLocation) bool {
|
||||||
|
_, found := location.FindEcVolume(needle.VolumeId(req.VolumeId))
|
||||||
|
return found
|
||||||
|
})
|
||||||
|
}
|
||||||
if location == nil {
|
if location == nil {
|
||||||
return nil, fmt.Errorf("no space left")
|
return nil, fmt.Errorf("no space left")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user