Skip to content

feat(backup): record the last stored object in status.lastObject - #6

Merged
mahdidarabi merged 1 commit into
mainfrom
feat/last-object
Dec 1, 2026
Merged

mahdidarabi merged 1 commit into
mainfrom
feat/last-object

Conversation

@mahdidarabi

Copy link
Copy Markdown
Collaborator

Stream Backups report the object they stored, the operator keeps it in status.lastObject, and a new metric and alert catch a dump that suddenly shrinks.

  • Pod → operator: report_object in stream/common.sh writes object=, size=, duration= to the container's termination message after the upload (or after the local write when S3 is off). Best effort: a backup that is stored never fails here.
  • Status: status.lastObject (key, sizeBytes, durationSeconds, jobName, completionTime) comes from the successful pod of the last finished Job. A failed Job, a Job whose pods are gone, or a pod that did not report keeps the previous object. Pods are read with the uncached API reader; the operator needs get/list on pods (config/rbac and the chart).
  • Metrics: karkive_backup_last_size_bytes, karkive_backup_last_object_timestamp_seconds, absent until an object is recorded.
  • Alert: KArkiveBackupSizeDrop when the last object is below backupSizeDropRatio (default 0.5) of the largest in backupSizeDropWindow (default 7d); 0 turns it off.

Adds an API field and an RBAC rule, so it ships as a minor release (0.7.0). Stage Backups are unchanged.

A Stream Backup pod now writes the object key, size and duration to its termination message. The operator copies it from the successful pod of the last finished Job into status.lastObject, reading that pod with the uncached API reader, so it needs get and list on pods. A failed Job, a Job whose pods are gone or a pod that did not report keeps the previous object, so lastObject always names a dump that was stored. Stage Backups do not report.

New metrics karkive_backup_last_size_bytes and karkive_backup_last_object_timestamp_seconds feed alert KArkiveBackupSizeDrop: the last object is below metrics.prometheusRule.backupSizeDropRatio (default 0.5) of the largest one in backupSizeDropWindow (default 7d), which usually means an empty or partial dump.
@mahdidarabi
mahdidarabi merged commit ae5169b into main Dec 1, 2026
3 checks passed
@mahdidarabi
mahdidarabi deleted the feat/last-object branch December 1, 2026 22:28
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