evacuate

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package evacuate adapts host-evacuation orchestration 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
	Jobs    store.JobStore
	Metrics jobs.Metrics // optional; nil-safe
	// Concurrency is the default child-migration bound (0 -> defaultEvacuateConcurrency).
	// A request's Concurrency overrides it per call. See effectiveConcurrency.
	Concurrency int
	// contains filtered or unexported fields
}

Handler runs "evacuate" jobs: resolve the host's instances into a migrate plan, run the migrations with bounded concurrency (each as a child migrate job), and aggregate onto the parent.

A parent evacuate occupies one runner pool worker for the whole fan-out (its children run as goroutines inside it and need no worker). That keeps a single evacuate deadlock-free, but a parent holds its worker for the duration, so many concurrent evacuates can starve plain migrate/other jobs of a slot. Acceptable at current scale; if many concurrent evacuates become common, give the runner headroom or a separate orchestration pool.

func (*Handler) Run

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

Jump to

Keyboard shortcuts

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