corromigrate

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package corromigrate handles the one-time migration of the on-disk Corrosion store from systemd-managed v0.x to v1.0.0 running in a uncloudd-managed container. TODO: remove in 0.22 assuming all pre 0.20 clusters upgraded their pre-v1 Corrosion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplySeedIfPresent

func ApplySeedIfPresent(ctx context.Context, dir string, st *store.Store) error

ApplySeedIfPresent re-applies the durable rows from the seed file into the running Corrosion store, then deletes the seed file as the final completion marker. Idempotent: re-running on the same seed is a no-op for cluster rows (INSERT OR REPLACE) and machines rows (skipped via GetMachine).

func MigrateIfNeeded

func MigrateIfNeeded(ctx context.Context, dir, owner string) error

MigrateIfNeeded stops the legacy systemd Corrosion unit and, when a v0.x store.db is detected, dumps its durable rows to a seed file next to the data dir, then backs up the dir so the new version can start fresh. Idempotent: if the seed file already exists, the dump step is skipped (a prior run already produced it).

Types

type ClusterEntry

type ClusterEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type MachineEntry

type MachineEntry struct {
	ID   string `json:"id"`
	Info string `json:"info"`
}

type Seed

type Seed struct {
	Cluster  []ClusterEntry `json:"cluster"`
	Machines []MachineEntry `json:"machines"`
}

Seed is the on-disk representation of the durable rows dumped from a v0.x Corrosion store, to be re-applied to the fresh v1.0.0 store. Existence of the seed file is the signal that migration has not yet fully completed.

Jump to

Keyboard shortcuts

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