diff options
Diffstat (limited to 'weed/server')
| -rw-r--r-- | weed/server/volume_grpc_admin.go | 2 | ||||
| -rw-r--r-- | weed/server/volume_grpc_copy.go | 11 | ||||
| -rw-r--r-- | weed/server/volume_grpc_erasure_coding.go | 2 |
3 files changed, 9 insertions, 6 deletions
diff --git a/weed/server/volume_grpc_admin.go b/weed/server/volume_grpc_admin.go index 9296c63e9..55bb6573e 100644 --- a/weed/server/volume_grpc_admin.go +++ b/weed/server/volume_grpc_admin.go @@ -3,6 +3,7 @@ package weed_server import ( "context" "fmt" + "github.com/chrislusf/seaweedfs/weed/storage" "path/filepath" "github.com/chrislusf/seaweedfs/weed/glog" @@ -41,6 +42,7 @@ func (vs *VolumeServer) AllocateVolume(ctx context.Context, req *volume_server_p req.Ttl, req.Preallocate, req.MemoryMapMaxSizeMb, + storage.DiskType(req.DiskType), ) if err != nil { diff --git a/weed/server/volume_grpc_copy.go b/weed/server/volume_grpc_copy.go index cfa3710a8..26c6b28e7 100644 --- a/weed/server/volume_grpc_copy.go +++ b/weed/server/volume_grpc_copy.go @@ -36,11 +36,6 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo glog.V(0).Infof("deleted existing volume %d before copying.", req.VolumeId) } - location := vs.store.FindFreeLocation() - if location == nil { - return nil, fmt.Errorf("no space left") - } - // the master will not start compaction for read-only volumes, so it is safe to just copy files directly // copy .dat and .idx files // read .idx .dat file size and timestamp @@ -59,6 +54,11 @@ func (vs *VolumeServer) VolumeCopy(ctx context.Context, req *volume_server_pb.Vo return fmt.Errorf("read volume file status failed, %v", err) } + location := vs.store.FindFreeLocation(storage.DiskType(volFileInfoResp.DiskType)) + if location == nil { + return fmt.Errorf("no space left") + } + dataBaseFileName = storage.VolumeFileName(location.Directory, volFileInfoResp.Collection, int(req.VolumeId)) indexBaseFileName = storage.VolumeFileName(location.IdxDirectory, volFileInfoResp.Collection, int(req.VolumeId)) @@ -206,6 +206,7 @@ func (vs *VolumeServer) ReadVolumeFileStatus(ctx context.Context, req *volume_se resp.FileCount = v.FileCount() resp.CompactionRevision = uint32(v.CompactionRevision) resp.Collection = v.Collection + resp.DiskType = string(v.DiskType()) return resp, nil } diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index 2a7076e04..e13afdf55 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -105,7 +105,7 @@ func (vs *VolumeServer) VolumeEcShardsCopy(ctx context.Context, req *volume_serv glog.V(0).Infof("VolumeEcShardsCopy: %v", req) - location := vs.store.FindFreeLocation() + location := vs.store.FindFreeLocation(storage.HardDriveType) if location == nil { return nil, fmt.Errorf("no space left") } |
