跳轉到

Tenax on-call runbook

Every Tenax alert links here. First steps for any alert:

kubectl -n tenax-system get pods                                  # controller, api, streamers, jobs
kubectl get backuptargets -A                                       # phase, last backup, PITR window
kubectl -n <ns> describe backuptarget <name>                       # conditions, events, messages
kubectl -n tenax-system logs deploy/tenax-controller --since=1h  # JSON logs (never contain secrets)
tenax targets --health error                                      # the console's view (CLI)

State lives in two places only: Tenax resources in the cluster and objects in the store. Any Tenax pod can be deleted at any time. A backup exists only once its manifest.json is written, and a half-finished one is cleaned up by garbage collection.

BackupOverdue

No successful full backup for 26 h (prod) or 50 h (other environments). TenaxBackupNeverSucceeded fires when a target has never had one.

  1. kubectl -n <ns> get backups -l tenax.run/target=<name> --sort-by=.metadata.creationTimestamp. Look at the newest backup's status.phase and status.message:
  2. Postponed (load guard): the database was busy at schedule time. The run is retried loadGuard.maxPostpones times, then runs anyway.
  3. Queued: waiting for a concurrency slot (tenax_slots_in_use, tenax_queue_depth). Another long backup on the same host holds the per-host slot.
  4. Failed: read the message. The mover Job's logs are in tenax-system (kubectl -n tenax-system logs job/<job>). Common causes:
    • Credentials: the tenax-* secret is wrong or missing in the target namespace.
    • Network: a NetworkPolicy in the target namespace must allow the tenax-system mover pods.
    • Stalled: no progress for stallTimeout; the watchdog killed the dump.
    • The store is unreachable: see StoreUnreachable.
  5. Fix the cause, then run tenax backup now <ns>/<name> --wait.
  6. A suspended target (spec.suspend: true, or paused from the console) never backs up. Resume it with kubectl patch or from the console. Git (Flux) restores spec.suspend on its next sync.

StreamLagHigh

The change stream is more than 5 minutes behind: recent seconds are not yet restorable.

  • kubectl -n tenax-system logs deploy/tenax-stream-<ns>-<name>-…: look for reconnect loops and upload errors.
  • The store is slow or unreachable (uploads retry with back-off): see StoreUnreachable.
  • A burst of writes larger than the upload bandwidth (limits.bandwidth): the lag drains by itself.
  • The streamer restarts by itself when it sees no stream activity for 3 minutes (liveness).

StreamChainBroken

Point-in-time restore has a gap. The streamer records why in stream/position.json, which shows as the target's status.pitr message:

  • Postgres: the slot was invalidated (max_slot_wal_keep_size), dropped, or the database was recreated or promoted (new system identifier or timeline).
  • MySQL: the binlog needed next was purged (binlog_expire_logs_seconds too short for an outage), or the server's identity changed.

Tenax starts a new chain at once and takes a full backup for it (reason chain-restart). Restores are possible up to the break and from the new base on; tenax restore refuses times in the gap and prints the restorable windows. Act on the cause: raise max_slot_wal_keep_size or binlog retention, and look for long outages of the streamer.

VerificationFailed

A scheduled or on-demand verification restore failed, or its checks failed. tenax-system events and the restore show which:

kubectl -n <ns> get restores -l tenax.run/verification=true --sort-by=.metadata.creationTimestamp
kubectl -n <ns> describe restore <name>      # status.checks: inventory-matches, schema-matches, row estimates, SQL
  • inventory-matches or schema-matches failed: the restored database differs from what the backup recorded. Treat this as a damaged backup. Pin the last good backup (tenax pin <id> --reason …), take a new full backup, and verify it (tenax verify <ns>/<name> --wait).
  • A row estimate is outside tolerance: usually a large table whose statistics were stale. Run ANALYZE on the source, or exclude the table from the check.
  • A target SQL check failed: look at the check's message. It is the target owner's assertion about their data.
  • The restore itself failed: the restorer logs are kept for 24 h (kubectl -n tenax-system logs job/<job>).

TenaxVerificationOverdue means no successful verification in 8 days: check the policy's verify.schedule, and whether verification restores fail to start (sandbox quota, images).

SlotWALRetentionHigh

A Postgres replication slot holds more than 75 % of max_slot_wal_keep_size. At 100 % Postgres invalidates the slot (the chain breaks), or, without a limit, the database disk fills.

  • The streamer is down or stuck: restart it (kubectl -n tenax-system rollout restart deploy/tenax-stream-…). It resumes from its confirmed position.
  • The slot belongs to a target that no longer streams. Tenax drops slots when PITR is turned off or the target is deleted (ADR 0011). If the cleanup failed, for example because the credentials secret went first, drop the slot by hand: select pg_drop_replication_slot('tenax_<ns>_<target>'); (names: select slot_name, active from pg_replication_slots;).

StoreUnreachable

tenax_store_up == 0 for 10 min: Tenax cannot list or write the bucket.

  • Credentials: the store's credentialsSecret (S3 key id and secret; on Telnyx both are the API key).
  • Endpoint and region: path-style SigV4. A wrong region usually returns 301 or 403.
  • Network: egress from tenax-system to the endpoint.

Backups fail (and retry on schedule) while the store is down. Change streams keep at most the current segment locally: they stop confirming, so the slot or binlog position holds the changes on the database until the store returns.

GCFailing

Garbage collection has not completed for 2 days. Expired backups stay, which costs storage but loses nothing. Look at the controller logs (gc messages) and the store's status.message. The plan of each run is written to gc/<time>.json in the store before anything is deleted.

BackupQuarantined

The scrub re-read a backup and its stored objects no longer match the manifest (a changed or missing object). The backup is quarantined: no automatic restore or verification uses it, and Tenax has already started a fresh full backup of the target.

  • See which backups and why: kubectl get events -A --field-selector reason=BackupQuarantined, or the report named in the store's status.lastScrubReportKey.
  • Check that the fresh backup succeeded: tenax backups <ns>/<target>.
  • Find the cause in the object store: lifecycle rules, replication, a person or tool writing under the Tenax prefix, or a failing storage system. One quarantined backup is an event; several are an incident with the store.

TenaxScrubOverdue means no scrub of a store has finished for 3 days: look for failed tenax-scrub-… Jobs in tenax-system and their logs, and at the store's events (ScrubFailed).

ReplicaBehind

A store's copy to one of its replicas (spec.replicas, ADR 0044) has not finished without errors for 6 hours, so backups taken since then may be missing from the replica.

  • See the replica's state: tenax stores, or kubectl get kstore <store> -o jsonpath='{.status.replicas}' (message, pending, lastSyncTime).
  • Look at the copy Jobs (tenax-replica-… in tenax-system) and their logs, and at the store's events (ReplicaCopyFailed, ReplicaCopyIncomplete).
  • Common causes: the replica is unreachable or out of space, its credentials changed, its encryption recipients no longer include the store's (the copy is refused with that message), or a copy is still running after a large first sync (the alert then clears by itself when it ends).
  • delete brake in the message means a run would have deleted most of the replica: nothing was deleted. Check that the store's prefix and bucket are right before anything else.

AnomalyIncident

Tenax saw unusual changes on a target: a mass delete far above its normal rate, a truncate, a dropped table, data that stopped compressing (a sign of encryption in place), or a full backup with far fewer rows than the one before. It has already pinned the last good backup, taken an extra backup, and marked the points after the start suspicious so no automatic restore uses them. It never restores over the live database by itself.

  • See what it found and what it did: tenax incidents <ns>/<target>. The incident lists the rollouts and Jobs that started shortly before it; that is time proximity only, not proof.
  • Look at the point before it: tenax restore <ns>/<target> --at <start> --wait opens a sandbox (or use the sandbox Tenax opened, when the policy has anomaly.sandbox: true).
  • If the change was intended (a migration, a cleanup): tenax incidents resolve <ns>/<target> <id> --intended --reason "…" makes the marked backups usable again. Otherwise resolve it once you have restored what you need.

SandboxExpiryFailing

Sandboxes are past their TTL and their namespaces still exist. Look at kubectl get sandboxes, the namespace tenax-sbx-<name> (stuck finalizers on objects inside it), and the controller logs. A sandbox finalizer is dropped after a timeout whatever happens, so a leftover namespace can be deleted by hand.

LocalModelFailed

An AIProvider's in-cluster model (ADR 0038) failed: kubectl get aiprovider <name> -o yaml shows the reason in status.local.message. A download that failed names the cause (an unknown model name, a registry it cannot reach: set ai.local.proxy and ai.local.caBundleConfigMap behind a proxy); retry it from the console, or delete the tenax-llm-<name> pod (on the node's disk, the default) or the tenax-llm-<name>-pull-* Job (on a volume). "Ran out of memory" means the model needs more than spec.local.resources gives it, and "waiting for a node" that no node has that much memory or disk free. "Storage class … does not exist" or "the model's volume is not bound": name an existing class (kubectl get storageclass) or remove spec.local.storageClass to keep the model on the node's disk. AI features fall back to the other providers meanwhile.

Restoring under pressure

See RESTORE.md.