Documentation
¶
Overview ¶
Package backup holds the OSS backup primitives around instance.Service: the local-directory blob store and the backup/restore job adapters (#66).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalDir ¶
type LocalDir struct {
// contains filtered or unexported fields
}
LocalDir is the OSS BlobStore: blobs are plain files under a root directory, written via temp-file + rename so a partial write is never visible as a complete blob.
A process crash mid-write can leave a .tmp-* file behind. Because the temp file lives inside the blob's key-prefix directory, a DeleteAll call on that prefix (e.g. to clean up a failed backup) reclaims it automatically.
func NewLocalDir ¶
NewLocalDir creates (if needed) and opens the root directory.
type Reconciler ¶
Reconciler recovers "backup" jobs interrupted by a daemon restart: the backup row is failed (unless the work actually completed), partial blobs are deleted, and the instance is restarted.
func (*Reconciler) Reconcile ¶
func (r *Reconciler) Reconcile(ctx context.Context, job store.Job, jc *jobs.JobContext) (store.JobState, string, bool, error)
Reconcile decodes the job args and drives the interrupted backup to a terminal state. Unparseable args are a permanent failure; an inconclusive host check (unreachable host) leaves the job reconciling for retry.
type RestoreHandler ¶
RestoreHandler runs "restore" jobs by delegating to instance.Service.Restore.
restore has no reconciler on purpose: an interrupted restore is resolved by boot recovery failing the job, and the operator re-running the restore — which is idempotent from the blob (it re-does teardown + import + verify).
func (*RestoreHandler) Run ¶
func (h *RestoreHandler) Run(ctx context.Context, job store.Job, jc *jobs.JobContext) error
Run unmarshals the job args into a RestoreRequest and performs the restore, reporting progress through the job context.