check

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Overview

Package check provides various configuration and health checks that can be run for move operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutoverOldName added in v0.15.0

func CutoverOldName(tableName string) string

CutoverOldName returns the name the move cutover renames a source table to (`<table>_old`). Unlike the migration package's utils.OldTableName, no truncation is applied — renameSafetyCheck instead rejects tables whose _old name would exceed MySQL's identifier limit before any rows are copied.

func RunChecks

func RunChecks(ctx context.Context, r Resources, logger *slog.Logger, scope ScopeFlag) error

RunChecks runs all checks that are registered for the given scope

Types

type Resources

type Resources struct {
	Sources        []SourceResource
	Targets        []applier.Target
	SourceTables   []*table.TableInfo
	CreateSentinel bool
	// GTID, when true, opts the move into the experimental GTID-based change
	// source. The configuration check uses this to additionally validate
	// gtid_mode and enforce_gtid_consistency on every source.
	GTID bool
	// MoveEverything is true when no explicit table list was supplied (i.e.
	// move.SourceTables is empty), so every table in each source database is
	// being moved. The source_schema_consistency check uses this to decide
	// whether to also require an identical table *set* across all sources: when
	// moving everything, an extra/missing table on one shard is a drift error;
	// when only a named subset is moved, tables outside that subset are ignored.
	MoveEverything bool
}

Resources contains the resources needed for move checks

type ScopeFlag

type ScopeFlag uint8

ScopeFlag scopes a check

const (
	ScopeNone ScopeFlag = iota
	ScopePreRun
	ScopePreflight
	ScopePostSetup
	ScopeResume
)

type SourceResource added in v0.13.0

type SourceResource struct {
	DB     *sql.DB
	Config *mysql.Config
	DSN    string
}

SourceResource holds per-source connection state for checks.

Jump to

Keyboard shortcuts

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