Files
seaweedfs/weed/command/scaffold/volume.toml
T
Chris LuandGitHub 2d25c39da4 volume: resolve the disk IO slow-latency threshold per disk (#10976)
* volume: resolve the disk IO slow-latency threshold per disk

volume.toml keys [volume.disk.io.slow.latency] by disk type, but the
threshold was chosen once per server by switching on the raw -disk flag.
-disk is comma-separated, one entry per -dir, so a multi-disk server
matched no case and silently took the hdd threshold.

Carry the table on DiskIOProbeConfig and resolve it in CheckDiskSpace
from the location's own DiskType. A type with no entry keeps falling
back to the hdd threshold.

* volume: run the disk IO probe on multi-directory volume servers

The probe was disabled whenever more than one -dir was configured,
because a single server-wide slow-latency threshold could not describe
disks of different types. The threshold is per disk now, and the rest of
the probe already is: diskRegistry is keyed by directory, each
DiskLocation runs its own CheckDiskSpace, and Store consults
isDiskUnavailable per location.

* volume: reject duplicate -dir entries

Nothing deduplicated -dir, so the same directory listed twice produced two
DiskLocations that each loaded every volume in it, appending to the same .dat
under two independent locks. Compare directory identity with os.SameFile
rather than the path, so a symlink or bind mount aliasing an earlier entry is
rejected as well.

* volume: cover the per-disk slow-latency handoff

SlowLatencyFor has a test, but nothing asserted that CheckDiskSpace feeds it
the location's own disk type. Probe through a seam so the resolved threshold
is observable, and check hdd, ssd, nvme, the empty type, and an unlisted tag.
2026-08-27 10:01:05 -07:00

30 lines
757 B
TOML

# Put this file to one of the location, with descending priority
# ./volume.toml
# $HOME/.seaweedfs/volume.toml
# /etc/seaweedfs/volume.toml
# this file is read by volume servers
[volume.disk.io]
# Disk IO probing is disabled by default. When enabled, a volume server can
# stop advertising a disk after sustained IO errors or latency degradation.
probe = false
timeout = "2s"
interval = "60s"
window = "1m"
min.samples = 10
max.stat.failures = 5
recovery.coef = 0.5
[volume.disk.io.slow]
percent = 20
[volume.disk.io.error]
percent = 10
# slow threshold per disk type, matched against each -dir's -disk tag.
# a disk whose type is not listed here uses the hdd threshold.
[volume.disk.io.slow.latency]
hdd = "500ms"
ssd = "100ms"
nvme = "50ms"