You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
controller: record exported diff size metric during backup
Set backup_exported_diff_size_bytes on the primary by summing the sizes
of all uploaded diff parts, obtained via HeadObject against the object
storage. The sum is recomputed and Set() on every reconcile, so the value
is idempotent and needs no persistence in MantleBackup.status.
The gauge is set from two places:
- startUpload, so the value is updated as each diff part finishes
uploading during normal operation.
- the beginning of reconcileAsPrimary, so the value is restored on the
first reconcile after a controller restart. startUpload is not always
reached because the replicate path may return early, whereas the
beginning of reconcileAsPrimary is always reached.
The uploaded parts stay in the object storage until the secondary cluster
cleans them up after import, which happens after the backup completes, so
HeadObject always succeeds while the backup is in progress. Unlike the
secondary, the primary does not initialize objectStorageClient elsewhere,
so prepare it lazily before HeadObject.
The metric is deleted when the MantleBackup is deleted, rather than when
SyncedToRemote becomes True, to avoid removing it before Prometheus
scrapes it. DeletePartialMatch is used because the sync_mode label value
may already have been removed by the cleanup that runs beforehand.
Signed-off-by: Kohya Shiozaki <kouyan120706@gmail.com>
0 commit comments