Files
seaweedfs/seaweed-block/cmd/blockvolume/host_limit.go
T
pingqiuandClaude Opus 5.5 598e8f9899 fix(hostlimit): an urgent cut on the static fallback is not rate-paced; a pacing error names the limiter
On a full or unusable --host-limit-dir only urgent work (the seal at stop)
runs, on the static fallback. Pacing it at BytesPerSecond/FallbackVolumes
(320 KiB/s by default) made detach --plain time out, reported as 'chunk
remote unavailable'. With no shared cap to protect it is not paced now, and
an upload-pacing error says so. Issue 486.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 00:53:13 -08:00

21 lines
1.4 KiB
Go

package main
import (
"flag"
"github.com/seaweedfs/seaweed-block/core/hostlimit"
)
func registerHostLimitFlags(fs *flag.FlagSet, c *hostlimit.Config) {
*c = hostlimit.DefaultConfig("")
fs.StringVar(&c.Directory, "host-limit-dir", "", "shared local directory for background-cut slots; empty disables shared slots")
fs.IntVar(&c.NormalSlots, "host-limit-normal-slots", c.NormalSlots, "host normal-cut slots; identical across processes")
fs.IntVar(&c.UrgentSlots, "host-limit-urgent-slots", c.UrgentSlots, "host reserved urgent-cut slots")
fs.IntVar(&c.FillSlots, "host-limit-fill-slots", c.FillSlots, "host background-fill slots; demand hydration bypasses them")
fs.IntVar(&c.IdleSlots, "host-limit-idle-slots", c.IdleSlots, "host idle-work slots")
fs.Int64Var(&c.PayloadBytes, "host-limit-payload-bytes", c.PayloadBytes, "maximum cut payload per slot")
fs.Int64Var(&c.COWBytes, "host-limit-cow-bytes", c.COWBytes, "maximum saved COW bytes per slot")
fs.Int64Var(&c.BytesPerSecond, "host-limit-upload-bytes-sec", c.BytesPerSecond, "pacing parameter divided per process by cut-slot count; not a host rate cap")
fs.IntVar(&c.FallbackVolumes, "host-limit-fallback-volumes", c.FallbackVolumes, "kept for configuration compatibility; the urgent fallback is not paced (no shared host cap to protect)")
fs.DurationVar(&c.MaxHold, "host-limit-max-hold", c.MaxHold, "cut lease timeout; expiration aborts but waits for admitted I/O before release")
}