Remove rate limit semaphore on master's leader selection logic. (#6494)
This was introduced by 054374c7 (2024-03-12) and serves no practical purpose,
yet it caps the maximum QPS master servers can handle.
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user