diff --git a/weed/server/master_grpc_server_assign.go b/weed/server/master_grpc_server_assign.go index 5839a6a73..7455c9ea4 100644 --- a/weed/server/master_grpc_server_assign.go +++ b/weed/server/master_grpc_server_assign.go @@ -85,7 +85,7 @@ func (ms *MasterServer) Assign(ctx context.Context, req *master_pb.AssignRequest return nil, fmt.Errorf("no free volumes left for " + option.String()) } vl.AddGrowRequest() - ms.vgCh <- &topology.VolumeGrowRequest{ + ms.volumeGrowthRequestChan <- &topology.VolumeGrowRequest{ Option: option, Count: int(req.WritableVolumeCount), } diff --git a/weed/server/master_grpc_server_volume.go b/weed/server/master_grpc_server_volume.go index a344e5221..503da7fd4 100644 --- a/weed/server/master_grpc_server_volume.go +++ b/weed/server/master_grpc_server_volume.go @@ -22,7 +22,7 @@ func (ms *MasterServer) ProcessGrowRequest() { go func() { filter := sync.Map{} for { - req, ok := <-ms.vgCh + req, ok := <-ms.volumeGrowthRequestChan if !ok { break } diff --git a/weed/server/master_server.go b/weed/server/master_server.go index 9a5313a10..a2f3c7692 100644 --- a/weed/server/master_server.go +++ b/weed/server/master_server.go @@ -60,8 +60,8 @@ type MasterServer struct { preallocateSize int64 Topo *topology.Topology - vg *topology.VolumeGrowth - vgCh chan *topology.VolumeGrowRequest + vg *topology.VolumeGrowth + volumeGrowthRequestChan chan *topology.VolumeGrowRequest boundedLeaderChan chan int @@ -105,14 +105,14 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers map[string]pb.Se grpcDialOption := security.LoadClientTLS(v, "grpc.master") ms := &MasterServer{ - option: option, - preallocateSize: preallocateSize, - vgCh: make(chan *topology.VolumeGrowRequest, 1<<6), - clientChans: make(map[string]chan *master_pb.KeepConnectedResponse), - grpcDialOption: grpcDialOption, - MasterClient: wdclient.NewMasterClient(grpcDialOption, "", cluster.MasterType, option.Master, "", "", *pb.NewServiceDiscoveryFromMap(peers)), - adminLocks: NewAdminLocks(), - Cluster: cluster.NewCluster(), + option: option, + preallocateSize: preallocateSize, + volumeGrowthRequestChan: make(chan *topology.VolumeGrowRequest, 1<<6), + clientChans: make(map[string]chan *master_pb.KeepConnectedResponse), + grpcDialOption: grpcDialOption, + MasterClient: wdclient.NewMasterClient(grpcDialOption, "", cluster.MasterType, option.Master, "", "", *pb.NewServiceDiscoveryFromMap(peers)), + adminLocks: NewAdminLocks(), + Cluster: cluster.NewCluster(), } ms.boundedLeaderChan = make(chan int, 16) diff --git a/weed/server/master_server_handlers.go b/weed/server/master_server_handlers.go index 9dc6351a4..e4188420d 100644 --- a/weed/server/master_server_handlers.go +++ b/weed/server/master_server_handlers.go @@ -136,7 +136,7 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request) return } vl.AddGrowRequest() - ms.vgCh <- &topology.VolumeGrowRequest{ + ms.volumeGrowthRequestChan <- &topology.VolumeGrowRequest{ Option: option, Count: writableVolumeCount, }