diff options
Diffstat (limited to 'weed/server')
| -rw-r--r-- | weed/server/volume_grpc_erasure_coding.go | 4 | ||||
| -rw-r--r-- | weed/server/volume_server_handlers_read.go | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index aa0f80442..6cb826d30 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -151,11 +151,11 @@ func (vs *VolumeServer) VolumeEcShardsUnmount(ctx context.Context, req *volume_s func (vs *VolumeServer) VolumeEcShardRead(req *volume_server_pb.VolumeEcShardReadRequest, stream volume_server_pb.VolumeServer_VolumeEcShardReadServer) error { - ecShards, found := vs.store.HasEcShard(needle.VolumeId(req.VolumeId)) + ecVolume, found := vs.store.FindEcVolume(needle.VolumeId(req.VolumeId)) if !found { return fmt.Errorf("not found ec volume id %d", req.VolumeId) } - ecShard, found := ecShards.FindEcVolumeShard(erasure_coding.ShardId(req.ShardId)) + ecShard, found := ecVolume.FindEcVolumeShard(erasure_coding.ShardId(req.ShardId)) if !found { return fmt.Errorf("not found ec shard %d.%d", req.VolumeId, req.ShardId) } diff --git a/weed/server/volume_server_handlers_read.go b/weed/server/volume_server_handlers_read.go index 2e32bae5f..839e17fbe 100644 --- a/weed/server/volume_server_handlers_read.go +++ b/weed/server/volume_server_handlers_read.go @@ -42,8 +42,8 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) glog.V(4).Infoln("volume", volumeId, "reading", n) hasVolume := vs.store.HasVolume(volumeId) - _, hasEcShard := vs.store.HasEcShard(volumeId) - if !hasVolume && !hasEcShard { + _, hasEcVolume := vs.store.FindEcVolume(volumeId) + if !hasVolume && !hasEcVolume { if !vs.ReadRedirect { glog.V(2).Infoln("volume is not local:", err, r.URL.Path) w.WriteHeader(http.StatusNotFound) @@ -71,7 +71,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request) var count int if hasVolume { count, err = vs.store.ReadVolumeNeedle(volumeId, n) - } else if hasEcShard { + } else if hasEcVolume { count, err = vs.store.ReadEcShardNeedle(context.Background(), volumeId, n) } glog.V(4).Infoln("read bytes", count, "error", err) |
