aboutsummaryrefslogtreecommitdiff
path: root/weed/server/master_server_handlers.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-10-05 01:58:30 -0700
committerChris Lu <chris.lu@gmail.com>2021-10-05 01:58:30 -0700
commit332d49432dfc5328b803ddbe540704d303500cfd (patch)
treeef4a35b5cf4641f31d9f3f22d211a31587c837c2 /weed/server/master_server_handlers.go
parent96119eab00e13ff056f3058b9032d12c3758cb35 (diff)
downloadseaweedfs-332d49432dfc5328b803ddbe540704d303500cfd.tar.xz
seaweedfs-332d49432dfc5328b803ddbe540704d303500cfd.zip
reduce concurrent volume grow requests
Diffstat (limited to 'weed/server/master_server_handlers.go')
-rw-r--r--weed/server/master_server_handlers.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/server/master_server_handlers.go b/weed/server/master_server_handlers.go
index 8187ca21f..50a3f12f6 100644
--- a/weed/server/master_server_handlers.go
+++ b/weed/server/master_server_handlers.go
@@ -115,13 +115,14 @@ func (ms *MasterServer) dirAssignHandler(w http.ResponseWriter, r *http.Request)
vl := ms.Topo.GetVolumeLayout(option.Collection, option.ReplicaPlacement, option.Ttl, option.DiskType)
- if vl.ShouldGrowVolumes(option) {
+ if !vl.HasGrowRequest() && vl.ShouldGrowVolumes(option) {
glog.V(0).Infof("dirAssign volume growth %v from %v", option.String(), r.RemoteAddr)
if ms.Topo.AvailableSpaceFor(option) <= 0 {
writeJsonQuiet(w, r, http.StatusNotFound, operation.AssignResult{Error: "No free volumes left for " + option.String()})
return
}
errCh := make(chan error, 1)
+ vl.AddGrowRequest()
ms.vgCh <- &topology.VolumeGrowRequest{
Option: option,
Count: writableVolumeCount,