|
@ -65,8 +65,6 @@ type MasterServer struct { |
|
|
vg *topology.VolumeGrowth |
|
|
vg *topology.VolumeGrowth |
|
|
volumeGrowthRequestChan chan *topology.VolumeGrowRequest |
|
|
volumeGrowthRequestChan chan *topology.VolumeGrowRequest |
|
|
|
|
|
|
|
|
boundedLeaderChan chan int |
|
|
|
|
|
|
|
|
|
|
|
// notifying clients
|
|
|
// notifying clients
|
|
|
clientChansLock sync.RWMutex |
|
|
clientChansLock sync.RWMutex |
|
|
clientChans map[string]chan *master_pb.KeepConnectedResponse |
|
|
clientChans map[string]chan *master_pb.KeepConnectedResponse |
|
@ -122,7 +120,6 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers map[string]pb.Se |
|
|
adminLocks: NewAdminLocks(), |
|
|
adminLocks: NewAdminLocks(), |
|
|
Cluster: cluster.NewCluster(), |
|
|
Cluster: cluster.NewCluster(), |
|
|
} |
|
|
} |
|
|
ms.boundedLeaderChan = make(chan int, 16) |
|
|
|
|
|
|
|
|
|
|
|
ms.MasterClient.SetOnPeerUpdateFn(ms.OnPeerUpdate) |
|
|
ms.MasterClient.SetOnPeerUpdateFn(ms.OnPeerUpdate) |
|
|
|
|
|
|
|
@ -228,8 +225,6 @@ func (ms *MasterServer) proxyToLeader(f http.HandlerFunc) http.HandlerFunc { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ms.boundedLeaderChan <- 1 |
|
|
|
|
|
defer func() { <-ms.boundedLeaderChan }() |
|
|
|
|
|
targetUrl, err := url.Parse("http://" + raftServerLeader) |
|
|
targetUrl, err := url.Parse("http://" + raftServerLeader) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
writeJsonError(w, r, http.StatusInternalServerError, |
|
|
writeJsonError(w, r, http.StatusInternalServerError, |
|
|