Skip to content

Anomalies and incidents

Most data loss is not a broken disk: it is a bad deploy, a wrong DELETE, a dropped table or ransomware, and the backups faithfully copy the damage. Tenax watches what changes in each target, notices when it is unusual, and keeps a good point safe before anyone has to decide anything. It never restores over your live database on its own.

What Tenax watches

Signal Strong when
Mass delete A table loses rows at 20 times its usual rate (10 times is a weak signal), at least 1,000 rows in a segment
Truncate Any TRUNCATE
Drop DROP TABLE, DROP DATABASE or DROP SCHEMA (a dropped column is a weak signal)
Compression drop Changes suddenly stop compressing: an early sign of data being encrypted in place
Rows drop A full backup holds fewer than a fifth of the rows of the one before (fewer than half is weak)

The first four come from the change stream, so they need point-in-time recovery; rows drop works for every target. Each target learns its own normal activity for about 20 segments before rate signals count, and unusual segments never become part of what is normal.

What happens on a strong signal

Within about a minute, Tenax opens an incident and:

  1. pins the newest verified backup from before it started (for 14 days), so retention cannot remove it;
  2. takes an extra full backup, as evidence of the current state;
  3. marks every point after the start suspicious: latest, points in time and verification skip them, but you can still restore one on purpose by its ID;
  4. lists the rollouts and Jobs that started in the 15 minutes before, as possible sources (time proximity only).

The target shows an Anomaly condition and the TenaxAnomalyIncident alert fires.

tenax incidents shop/orders
INCIDENT          STRENGTH  START                 STATE  PINNED                   SUMMARY
20261020T140311Z  strong    2026-10-20T14:03:11Z  open   20261020T140258Z-1a2b3c  12408 rows deleted from app.public.invoices in under a minute, 38x the usual rate
                                                         near: rollout shop/billing-worker billing:1.4.2 at 2026-10-20T14:00:02Z (time proximity only)

Deciding what to do

  • Look at the point before: tenax restore shop/orders --at 2026-10-20T14:03:10Z --wait opens it in a sandbox.
  • If it was intended (a cleanup job, a migration), resolve it as intended: the suspicious marks are cleared.
tenax incidents resolve shop/orders 20261020T140311Z --intended --reason "yearly cleanup of old invoices"
  • If it was not, restore what you need (into a sandbox, a new database, or in place), then resolve it with the reason.

Settings

in a BackupPolicy
spec:
  anomaly:
    minRows: 1000          # smaller deletes never count as a mass delete
    sandbox: false         # true: also open a sandbox at the point just before a strong incident
    contextNamespaces: [shop-apps]   # where the services writing to the database run
    # disabled: true       # turn scoring off for this policy's targets

Listing rollouts and Jobs needs read-only cluster-wide list on ReplicaSets and Jobs; set the chart value controller.incidentContext: false to leave it out. Row estimates come from the database's statistics, so after a mass delete without ANALYZE, the rows-drop signal can wait for autovacuum; the change-stream signals do not.