Skip to content

Feature/planned verify - #18

Merged
wvcollenburg merged 2 commits into
masterfrom
feature/planned-verify
Nov 21, 2026
Merged

wvcollenburg merged 2 commits into
masterfrom
feature/planned-verify

Conversation

@wvcollenburg

Copy link
Copy Markdown
Owner

Planned verification per folder, DR clusters, verification alerts (1.6.0)

Problem

Chain verification was a fixed job, every Sunday at 05:00:

  • It re-read every active chain in full, one after another, through one proxy.
  • It took no proxy lock, so it ran alongside backups on the same proxy.
  • Its cost grew every week until the next full backup.
  • A new restore point waited up to six days for its first check.
  • A failure was only visible in the restore points list; nobody was told.

Change

Planned verification, per folder

  • Every restore point of the folder is re-checked against its checksums once per interval. This includes retired chains, which can still be restored.

  • The check runs one point at a time, using the proxy's existing verify job with seq; the proxy itself is unchanged.

  • New points go first, so a point is checked within a day.

  • Backup → Schedules → Verification sets the interval (default 7 days, 0 = off) and the hours for production proxies (default 01:00–06:00, local to each cluster). It also shows counts (verified within the interval, not yet verified, overdue, failed) and, per proxy, whether it works now and its measured read speed.

  • A verification is a proxy job: it takes the proxy's lock, like a backup or restore. A backup or restore that needs the proxy stops the verification on it, which is checked again later.

  • A production proxy verifies only:

    • within the folder's hours;
    • while its cluster has no backups running or due;
    • a point predicted to finish before the hours end and before the cluster's next backups (from the point's size and the proxy's measured read speed).

    A check cut off at the end of the hours continues the next night.

DR clusters

  • A cluster can be marked DR (normally passive) in its Edit dialog.
  • Its proxies verify the folder's points around the clock: first what is due, then anything not checked for a day.
  • They pause between points while the folder's backups write to the share, unless the folder allows otherwise.

Alerts and email

  • A failed point is checked a second time before it counts. This rules out a share hiccup, or retention removing the point mid-read.
  • A confirmed failure, or a chain with a point not verified for twice the interval, opens a row in backup.verify_alerts. It shows on the cluster card as a critical (failed) or warning (overdue) badge.
  • A dashboard thread claims new rows atomically (FOR UPDATE SKIP LOCKED, so they are safe across gunicorn workers). It sends one email per folder to the closest admin: the folder's admins, else the customer's, else the MSP's, else the installation's.
  • The manual Verify button and the check before a restore also record the attempt and open or close the alert.

Also

  • A Verified column per chain on Restore points, and a verification history on Runs (proxy, size, duration).
  • New texts in en/nl/de/fr; new email texts (verify_failed, verify_overdue) in all four languages.
  • Migration 052_planned_verify.sql: backup.verify_settings, config.clusters.role, backup.points.verify_checked_at, backup.verify_runs, backup.verify_alerts.
  • Manual (Backup, Settings), administration guide and CHANGELOG updated.

Tests

  • tests/test_backup_verifier.py:
    • hours local to the cluster, including past midnight;
    • production proxies: inside their hours only, never during backup work, a point must fit before the hours end and the next backups, one point per chain at a time, the proxy lock is held;
    • DR proxies: around the clock, continuous after the due points, paused while backups write the share;
    • the second check before a failure counts;
    • no verdict when a backup of the VM starts or retention prunes the point;
    • a stop at the end of the hours;
    • a restore making the verification step aside;
    • overdue alerts.
  • tests/test_verify_mail.py: closest-admin rules, one email per kind per folder, the atomic claim, no mail when mail is not set up.
  • Full suite: 680 passed.
  • Live on a local stack with two real clusters in one folder:
    • The DR proxy on WDvCN11 verified a Lab241 restore point from the shared NAS (2.2 GiB at ~104 MiB/s) and did not repeat it on the next round.
    • An alert row showed on the cluster card as critical.
    • Recipients resolved to the folder admins.
    • The Schedules, Restore points, Runs and cluster dialog views worked without browser errors.

Not tested live

  • The failure email itself (unit tests only).
  • A backup or restore stopping a running verification (unit test only).
  • Whether a DR verification slows a concurrent backup on the same share. The DR pause during backups is the default until that is measured.

Notes

  • Verification emails are sent in English: user accounts have no language preference stored.
  • Upgrading needs no action. Every folder starts on the defaults (weekly, 01:00–06:00), and existing verification results carry over.

William David van Collenburg added 2 commits November 21, 2026 21:10
… the closest admin

Replaces the hard-coded Sunday 05:00 re-read of every chain.

- Every restore point of a folder (active and retired chains) is re-hashed once per interval,
  point by point (proxy verify with seq), as a proxy job that takes the proxy's lock.
  Production proxies work inside the folder's hours (local to each cluster), only when their
  cluster has no backup work running or due, and only on a point that fits before the hours end
  and the next backups start; a check cut off at the end continues the next night. New points
  first. Backups and restores preempt a running verification.
- A cluster can be marked DR (normally passive): its proxies verify around the clock, pausing
  between points while backups of the folder write to the share unless the folder allows it.
- A failure is checked a second time before it counts. A failed point or a chain unverified for
  twice the interval opens a backup.verify_alerts row: a badge on the cluster card (critical /
  warning) and one mail per folder to the closest admin (folder > customer > MSP > installation),
  claimed atomically by a dashboard thread.
- Backup -> Schedules -> Verification (settings, counts, proxies), a Verified column on restore
  points, verification history on Runs, the role in the cluster dialog. Texts in en/nl/de/fr.
- Migration 052. Manual, administration guide and CHANGELOG updated.
@wvcollenburg
wvcollenburg merged commit b9061a0 into master Nov 21, 2026
2 checks passed
@wvcollenburg
wvcollenburg deleted the feature/planned-verify branch November 21, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant