Browse Source

fix for spreading ec shards

pull/5976/head
chrislu 4 months ago
parent
commit
8d5a6d7e74
  1. 9
      weed/server/volume_grpc_erasure_coding.go

9
weed/server/volume_grpc_erasure_coding.go

@ -143,10 +143,17 @@ func (vs *VolumeServer) VolumeEcShardsCopy(ctx context.Context, req *volume_serv
glog.V(0).Infof("VolumeEcShardsCopy: %v", req)
location := vs.store.FindFreeLocation(func(location *storage.DiskLocation) bool {
var location *storage.DiskLocation
if req.CopyEcxFile {
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 {
return nil, fmt.Errorf("no space left")
}

Loading…
Cancel
Save