From d9236a9c7f1d3d9b010389f466ce8d2dc2040ee7 Mon Sep 17 00:00:00 2001 From: "user.email" Date: Sun, 25 Oct 2026 02:50:54 -0700 Subject: [PATCH] master: re-check the allocation deadline while it is held MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NextVolumeId slept for the whole computed delay, so a heartbeat landing mid-sleep that pushed the quiet deadline out was ignored — the pending allocation could still run ahead of a straggler's report. Wait in short slices, re-evaluating the deadline and the growth freeze each round. --- weed/topology/topology.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/topology/topology.go b/weed/topology/topology.go index e66b4ec408..e13e7af689 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -625,6 +625,11 @@ func (t *Topology) NextVolumeId() (needle.VolumeId, error) { } if wait := t.allocationDelay(); wait > 0 { glog.V(0).Infof("deferring volume id allocation for %v", wait) + } + for wait := t.allocationDelay(); wait > 0; wait = t.allocationDelay() { + if wait > 500*time.Millisecond { + wait = 500 * time.Millisecond + } time.Sleep(wait) if t.IsGrowthFrozen() { return 0, fmt.Errorf("volume growth is frozen after master state loss; verify the cluster inventory, then run: volume.growth.resume")