[master] avoid crowded more writable for auto grow (#6214)

avoid crowded more writable
https://github.com/seaweedfs/seaweedfs/issues/6121
This commit is contained in:
Konstantin Lebedev
2024-11-21 13:57:42 +05:00
committed by GitHub
parent 75f5afa571
commit a49d9e020c
2 changed files with 8 additions and 8 deletions

View File

@@ -43,12 +43,12 @@ func (ms *MasterServer) DoAutomaticVolumeGrow(req *topology.VolumeGrowRequest) {
func (ms *MasterServer) ProcessGrowRequest() {
go func() {
ctx := context.Background()
firstRun := true
firstRun := true
for {
if firstRun {
firstRun = false
firstRun = false
} else {
time.Sleep(14*time.Minute + time.Duration(120*rand.Float32())*time.Second)
time.Sleep(5*time.Minute + time.Duration(30*rand.Float32())*time.Second)
}
if !ms.Topo.IsLeader() {
continue
@@ -71,9 +71,6 @@ func (ms *MasterServer) ProcessGrowRequest() {
case mustGrow > 0:
vgr.WritableVolumeCount = uint32(mustGrow)
_, err = ms.VolumeGrow(ctx, vgr)
case crowded+volumeGrowStepCount >= writable:
vgr.WritableVolumeCount = volumeGrowStepCount
_, err = ms.VolumeGrow(ctx, vgr)
default:
for _, dc := range dcs {
if vl.ShouldGrowVolumesByDataNode("DataCenter", dc) {