migrate

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package migrate adapts the instance migrate algorithm to the jobs runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Svc     *instance.Service
	Metrics jobs.Metrics // optional; nil-safe
}

Handler runs "migrate" jobs by delegating to instance.Service.Migrate.

func (*Handler) Run

func (h *Handler) Run(ctx context.Context, job store.Job, jc *jobs.JobContext) error

Run unmarshals the job args into a MigrateRequest and performs the migration, reporting progress through the job context. If the migration rolls back, the rollback is recorded in Metrics.

type Reconciler

type Reconciler struct {
	Svc *instance.Service
}

Reconciler adapts instance.Service.ReconcileMigrate to the jobs runner's Reconciler contract, recovering migrate jobs interrupted by a daemon restart.

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 migrate to a consistent state. Unparseable args are a permanent failure (the job cannot be acted on); an inconclusive host check leaves the job reconciling for retry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL