Skip to content

SeaweedFS - fix volume slot exhaustion and stop it recurring #380

Description

@i5okie

Overview

SeaweedFS in ca7f8f-tools had run out of volume slots, leaving dts-traces-dev and
dts-traces-prod pinned at a single writable volume each. This was never a disk-space
problem — the volume servers were sitting at 46–65% utilisation throughout. SeaweedFS
divides a disk into fixed slots, and the cluster was over-subscribed on slots while having
plenty of free bytes.

The root cause was the upstream default volume growth strategy. copy_1 = 7 / copy_2 = 6
means a single grow event allocates 7 volumes on 000 replication and 12 on 001
defaults written for multi-terabyte deployments, applied to a ~250GB one. This also
explained the poor packing: with a dozen volumes open at once, writes spread thin and none
of them ever filled (ha-volume-0 averaged 318MB against a 1000MB cap).

Quota was raised 270Gi → 360Gi to fund the remediation.

Completed

  • Expand and equalise the HA volume servers — 50/100/50 → 100/100/100Gi
  • Expand dev volume server 15 → 32Gi
  • Reclaim the three HA master PVCs 5Gi → 1Gi (frees 12Gi; masters hold only raft
    log/snapshots, well under 1Gi)
  • volumeGrowthCount 7/6 → 2 — the actual fix; a grow event now costs 4 volumes on
    HA and 2 on dev
  • Raise minFreeSpacePercent 1 → 5 so vacuum always has room to rewrite a volume
  • Purge the filer metadata log and reclaim ~12 GiB via an explicit 0.10 vacuum pass
  • Weekly CronJob to purge the filer metadata log (no upstream retention setting exists)
  • Mark the 7 stale filer-log volumes read-only so they drain instead of being merged
  • Reconcile the values files with reality — they declared 45Gi/6Gi while live was
    50/100/50 and 15Gi

Result: HA free slots 17 → 68, dev 1 → 8. No data moved, no restarts beyond planned
rolling updates, ingestion uninterrupted.

Remaining

  • 2026-08-30: manually run volume.deleteEmpty — now automatic, see comment below
  • Add volume.deleteEmpty to the purge CronJob so the cycle is self-maintaining
    (also fixed: the job purged only one of the two filers)
  • Re-assess whether volume.balance is still needed after the drain (it self-corrects
    much of the 78/92/78 skew)
  • Production posture review — see Issues below

Issues

Gaps found during this work that are not fixed and need their own decisions:

  • No shared filer store. Both HA filers run independent embedded LevelDB2 databases with
    no backup, kept consistent only by asynchronously replaying each other's metadata change
    log. Verified converging today, but the metadata is the name→needle mapping — lose it and
    the bytes are unaddressable. Options are a tiny single-pod Postgres with stateless filers,
    or dropping to one filer plus weed filer.meta.backup.
  • Automatic vacuum is effectively dead on HA. Zero of 236 volumes exceeded the 0.3
    default garbage threshold, so the built-in loop walks the whole list and compacts nothing.
    It took a manual 0.10 pass to recover ~12 GiB.
  • dts-logs-test-chunks holds 120 volumes for 28.5 GiB (466 MB/vol) after a past log
    flood. Retention will not reclaim these — the volumes stay writable so none ever empties.
  • dev has no redundancy — single master, volume server and filer, replication: 000.
  • SeaweedFSDiskUtilizationHigh thresholds never lead — set high enough (160 GiB HA /
    12 GiB dev) that the slot alert always trips first.
  • Admin UI is on a public ingress (dts-seaweedfs-ha.apps.silver.devops.gov.bc.ca).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions