mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
- hostlimit: Config.YieldAfter (S, default 5 min). ShouldYield answers yes only for a Normal hold at least S old while another cut on the host holds a live ticket this process has not judged stalled (dead tickets are reaped on the way); the probe runs only once the hold is old enough and takes no limiter lock. - storage: a cut attempt asks at each staging batch boundary and ends with ErrCutYielded, keeping what it staged; CutsYielded counts it, never as a failed cut. - durable: a yielded attempt is retried at the next poll with no backoff, on a ticket at the back (it was admitted), counted in status (CutYields) and not logged as a failure. - blockvolume: --host-limit-yield-after. Invariants: INV-HOST-CUT-YIELD-001; M7 states the rule. v1.1 notes carry it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
2.2 KiB
Go
24 lines
2.2 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. --host-limit-no-progress must exceed one chunk's send time at this rate per held slot, or a steadily sending cut is revoked")
|
|
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.IntVar(&c.FetchSlots, "host-limit-fetch-slots", c.FetchSlots, "chunk fetches in flight on the host, across its processes (1-1024); a read of an absent chunk waits for a slot, bounded by its read-miss timeout")
|
|
fs.DurationVar(&c.YieldAfter, "host-limit-yield-after", c.YieldAfter, "a normal cut that has held its slot this long gives it to a waiting cut at its next staging batch (keeping what it staged); a lone cut never yields")
|
|
fs.DurationVar(&c.NoProgress, "host-limit-no-progress", c.NoProgress, "a held slot is revoked after this long with no progress of its work (chunks compared, staged, uploaded or filled); revocation aborts but waits for admitted I/O before release")
|
|
fs.DurationVar(&c.NoProgress, "host-limit-max-hold", c.NoProgress, "deprecated: the same as --host-limit-no-progress (a hold is no longer limited by its age)")
|
|
}
|