Documentation
¶
Overview ¶
Package check provides various configuration and health checks that can be run against a sql.DB connection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReplicaNotHealthy = fmt.Errorf("replica is not healthy")
ErrReplicaNotHealthy is returned when a replica's IO or SQL thread is not running.
Functions ¶
Types ¶
type Resources ¶
type Resources struct {
DB *sql.DB
Replicas []*sql.DB
Table *table.TableInfo
Statement *statement.AbstractStatement
TargetChunkTime time.Duration
Threads int
ReplicaMaxLag time.Duration
SkipDropAfterCutover bool
ForceKill bool
// The following resources are only used by the
// pre-run checks
Host string
Username string
Password string
TLSMode string
TLSCertificatePath string
// GTID, when true, opts the migration into the experimental GTID-based
// change source. The configuration check uses this to additionally
// validate gtid_mode and enforce_gtid_consistency on the source.
GTID bool
}
type ScopeFlag ¶
type ScopeFlag uint8
ScopeFlag scopes a check
const ( ScopeNone ScopeFlag = 0 ScopePreRun ScopeFlag = 1 << 0 ScopePreflight ScopeFlag = 1 << 1 ScopePostSetup ScopeFlag = 1 << 2 ScopeCutover ScopeFlag = 1 << 3 ScopePostCutover ScopeFlag = 1 << 4 ScopeTesting ScopeFlag = 1 << 5 // ScopeStatement marks preflight checks that classify the ALTER statement // itself: they decide from the parsed statement alone whether Spirit // refuses to run it, never touching a database connection. Callers can run // them via RunChecks with only Resources.Statement set (Table is optional // and widens coverage when present) to determine up front that a statement // would be refused — for example, a planning tool classifying DDL before // an apply. Passing these checks is not a promise Spirit will accept the // statement: checks that need a live connection (existing foreign keys, // triggers, privileges, ...) still run only at preflight. A check tagged // with this scope must tolerate every Resources field except Statement // being unset. ScopeStatement ScopeFlag = 1 << 6 )
Click to show internal directories.
Click to hide internal directories.