topology: wake the vacuum dispatcher when a worker frees quota (#11436)

* topology: wake the vacuum dispatcher when a worker frees quota

The dispatch loop slept a fixed 10s whenever every pending volume was
waiting for a per-server quota slot, so a sweep took volumes x 10s
regardless of how fast the compactions were. Workers now signal on a
buffered channel after crediting quota; the dispatcher waits on it with
the 10s sleep kept only as a timeout.

* master: add -vacuumIntervalSeconds to tune the automatic sweep interval

The 14-minute base interval was a literal inside the refresh loop while
every neighbouring vacuum knob was already a flag. Defaults to 840s,
unchanged.

* topology: keep the 14 minute floor on the vacuum interval

A zero-valued MasterOption or a negative -vacuumIntervalSeconds left the
sweep sleeping only its jitter, so treat non-positive intervals as the
previous default.
This commit is contained in:
Chris Lu authored and GitHub committed 2026-09-25 02:14:59 +08:00
1 parent 8c1be63c92
commit 56d2f05ccd
7 files changed
+22 -3

No files matched your search

+2
View File
@@ -51,6 +51,7 @@ type MasterOption struct {
FileSizeLimitMB int
VolumePreallocate bool
MaxParallelVacuumPerServer int
VacuumIntervalSeconds int
// PulseSeconds int
DefaultReplicaPlacement string
GarbageThreshold float64
@@ -202,6 +203,7 @@ func NewMasterServer(r *mux.Router, option *MasterOption, peers map[string]pb.Se
ms.option.MaxParallelVacuumPerServer,
topology.VolumeGrowStrategy.Threshold,
ms.preallocateSize,
time.Duration(ms.option.VacuumIntervalSeconds)*time.Second,
)
ms.ProcessGrowRequest()