Documentation
¶
Index ¶
- type CutOver
- type CutOverSource
- type Move
- type Runner
- func (r *Runner) Cancel()
- func (r *Runner) Close() error
- func (r *Runner) DumpCheckpoint(ctx context.Context) error
- func (r *Runner) Progress() status.Progress
- func (r *Runner) Run(ctx context.Context) error
- func (r *Runner) SetCutover(cutover func(ctx context.Context) error)
- func (r *Runner) SetLogger(logger *slog.Logger)
- func (r *Runner) Status() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CutOver ¶
type CutOver struct {
// contains filtered or unexported fields
}
type CutOverSource ¶ added in v0.13.0
CutOverSource holds per-source state needed for the cutover.
type Move ¶
type Move struct {
SourceDSN string `name:"source-dsn" help:"Where to copy the tables from." default:"spirit:spirit@tcp(127.0.0.1:3306)/src"`
TargetDSN string `name:"target-dsn" help:"Where to copy the tables to." default:"spirit:spirit@tcp(127.0.0.1:3306)/dest"`
TargetChunkTime time.Duration `name:"target-chunk-time" help:"How long each chunk should take to copy" default:"5s"`
Threads int `name:"threads" help:"How many chunks to copy in parallel" default:"2"`
WriteThreads int `name:"write-threads" help:"How many concurrent write threads to use per target" default:"2"`
CreateSentinel bool `name:"create-sentinel" help:"Create a sentinel table on the source database to block after table copy" default:"false"`
DeferSecondaryIndexes bool `name:"defer-secondary-indexes" help:"Create target tables without secondary indexes, add them before cutover" default:"false"`
// SourceTables optionally specifies a list of tables to move.
// If empty, all tables in the source database will be moved.
// This is useful for Vitess MoveTables operations where only specific tables should be moved.
SourceTables []string
// ShardingProvider optionally provides vindex metadata for resharding operations.
// If nil, tables will not have vindex configuration (suitable for simple MoveTables 1:1 operations).
// For resharding operations (1:many), this should be set to provide sharding key information.
// The provider is called during table discovery to configure ShardingColumn and HashFunc
// on each TableInfo.
// SourceDSNs optionally specifies multiple source DSNs for N:M resharding operations.
// When set, each DSN represents a separate source shard. All sources must have identical
// table schemas. If empty, SourceDSN is used as the single source.
SourceDSNs []string `kong:"-"`
ShardingProvider table.ShardingMetadataProvider `kong:"-"`
Targets []applier.Target `kong:"-"`
}
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) DumpCheckpoint ¶
DumpCheckpoint is called approximately every minute. It writes the current state of the migration to the checkpoint table, which can be used in recovery. Previously resuming from checkpoint would always restart at the copier, but it can now also resume at the checksum phase.
Click to show internal directories.
Click to hide internal directories.