Documentation
¶
Overview ¶
Package driver defines the L4 database abstraction for HA orchestration. See docs/architecture.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotImplemented = errors.New("database driver: not implemented")
ErrNotImplemented is returned by stub driver methods.
Functions ¶
This section is empty.
Types ¶
type CandidacyEvaluator ¶
type CandidacyEvaluator interface {
Promotable(ctx context.Context) (ok bool, reason string)
ReplicationLagBytes(ctx context.Context) (int64, error)
}
CandidacyEvaluator answers whether this node may become primary.
type Driver ¶
type Driver interface {
Type() Engine
Lifecycle
CandidacyEvaluator
RoleApplier
StatusReporter
}
Driver is the unified database facade for HA orchestration.
type FailoverPolicyApplier ¶ added in v0.3.0
type FailoverPolicyApplier interface {
SetFailoverPolicy(clusterconfig.FailoverPolicy)
}
FailoverPolicyApplier receives DCS failover policy updates from the reconciler.
type MGRLifecycle ¶
type MGRLifecycle interface {
IsMGRMode() bool
MGRPrimaryPhase1Done(ctx context.Context) (bool, error)
MGRClusterWritableReady(ctx context.Context) (bool, error)
ApplyPrimaryMGRPhase2(ctx context.Context) error
// MGRReplicaJoined reports whether local mysqld is a live MGR secondary.
MGRReplicaJoined(ctx context.Context) (bool, error)
}
MGRLifecycle covers MySQL Group Replication two-phase primary apply. Implemented by internal/database/mysql.Driver when repl_mode is MGR.
type PrimaryRef ¶
PrimaryRef identifies the cluster primary for replica setup.
type ReplicaConnectivity ¶ added in v0.3.0
type ReplicaConnectivity interface {
ReplicaConnectedToPrimary(ctx context.Context, primary PrimaryRef) (bool, error)
}
ReplicaConnectivity reports whether replication to the primary is healthy.
type Role ¶
type Role int
Role is the desired or observed replication role from the HA layer's view.