borg-backup-ui icon indicating copy to clipboard operation
borg-backup-ui copied to clipboard

Stagger and lower the priority of automatic repository information refresh

Open borg-codex-bot opened this issue 4 months ago • 0 comments

Summary

Automatic repository information refresh should not start expensive Borg operations for many repositories at the same time or compete with backups and interactive maintenance. Refresh work should be staggered, low priority and cache-aware.

Problem

  • Refreshing repository metadata can consume noticeable CPU, I/O and network bandwidth.
  • A burst across several local, USB or SSH repositories can increase load and create Borg lock contention.
  • Background refreshes should remain operationally different from an explicit user refresh.

Scope

  • Refresh stale repository information incrementally instead of as one startup or interval burst.
  • Limit background refresh concurrency, preferably to one repository at a time.
  • Run background Borg information commands with reduced CPU and I/O priority where supported.
  • Skip or defer repositories used by backups, restores, restore tests or maintenance.
  • Keep the existing manual refresh action immediate and visible.
  • Persist cache timestamps and clear, privacy-safe failure details.

Acceptance Criteria

  • Automatic refreshes are distributed over time and do not start for every repository simultaneously.
  • Background commands use reduced process priority without changing manual operations.
  • Active Borg work is not disturbed and transient lock contention is deferred rather than surfaced as repository damage.
  • Repository information remains available from the latest successful cache.
  • Tests cover scheduling, stale-cache selection, busy-repository deferral and manual refresh behavior.

User Impact

Repository statistics remain useful while automatic maintenance causes less CPU, disk and network load and fewer lock conflicts.

borg-codex-bot avatar Jul 14 '26 10:07 borg-codex-bot