Documentation
¶
Index ¶
- type CutOver
- 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 loggers.Advanced)
- 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
}
func NewCutOver ¶
func NewCutOver(db *sql.DB, tables []*table.TableInfo, cutoverFunc func(ctx context.Context) error, feed *repl.Client, dbConfig *dbconn.DBConfig, logger loggers.Advanced) (*CutOver, error)
NewCutOver contains the logic to perform the final cut over. It can cutover multiple tables at once based on config. A replication feed which is used to ensure consistency before the cut over.
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"`
CreateSentinel bool `name:"create-sentinel" help:"Create a sentinel table in the target database to block after table copy" default:"true"`
}
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.