Skip to content

Use disk-space quota (not filesystem free space) when driving storage reclamation #593

@kriszyp

Description

@kriszyp

When a disk-space quota is configured, Harper should use it (not the underlying filesystem's free space) when computing available free space for the purpose of driving storage reclamation. Today this either uses raw filesystem free space or doesn't react until disk fills.

Why this matters

In containerized / multi-tenant deployments, a Harper instance often has a quota smaller than the disk. Treating the quota as the headroom is necessary so reclamation kicks in based on Harper's bounded share, not the underlying filesystem's free space (which could be near zero from other tenants, or near full when Harper is at quota).

Asks

  • Where Harper computes "free space" for reclamation decisions, prefer the configured quota minus current Harper usage over statvfs-style filesystem free space when a quota is in force.
  • Surface the effective free-space basis (quota vs. filesystem) in the analytics / metrics output so operators can verify the right calculation is being used.

Acceptance criteria

  • With a quota configured, reclamation triggers based on quota headroom.
  • With no quota, behavior unchanged.
  • Operator-visible signal of which basis is being used.

Related

  • CORE-3006 — configurable write-stop threshold (when storage % reaches X, writes stop). Same headroom concept.
  • HarperFast/harper#566 — configurable analytics retention (separate concern but shares the "operator-controllable storage growth" theme).

Tracked in Jira: CORE-3011

🤖 Filed by Claude on behalf of Kris.

Metadata

Metadata

Assignees

Labels

area:storageStorage engine, LMDB/RocksDB, compactionenhancementNew feature or requestfrom-jiraMigrated or originated from a Jira ticket

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions