mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
master: re-check the allocation deadline while it is held
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.
This commit is contained in:
1 parent
9cc1f0dc36
commit
d9236a9c7f
1 file changed
+5
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user