replicator

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultChannelName = ""

Variables

View Source
var ErrGroupReplicationNotReady = errors.New("Error 3092: The server is not configured properly to be an active member of the group.")
View Source
var ErrRestartAfterClone error = errors.New("Error 3707: Restart server failed (mysqld is not managed by supervisor process).")

Functions

This section is empty.

Types

type MemberState added in v0.2.0

type MemberState string
const (
	MemberStateOnline      MemberState = "ONLINE"
	MemberStateRecovering  MemberState = "RECOVERING"
	MemberStateOffline     MemberState = "OFFLINE"
	MemberStateError       MemberState = "ERROR"
	MemberStateUnreachable MemberState = "UNREACHABLE"
)

type ReplicationStatus

type ReplicationStatus int8
const (
	ReplicationStatusActive ReplicationStatus = iota
	ReplicationStatusError
	ReplicationStatusNotInitiated
)

type Replicator

type Replicator interface {
	ChangeReplicationSource(ctx context.Context, host, replicaPass string, port int32) error
	StartReplication(ctx context.Context, host, replicaPass string, port int32) error
	StopReplication(ctx context.Context) error
	ResetReplication(ctx context.Context) error
	ReplicationStatus(ctx context.Context) (ReplicationStatus, string, error)
	EnableSuperReadonly(ctx context.Context) error
	DisableSuperReadonly(ctx context.Context) error
	IsReadonly(ctx context.Context) (bool, error)
	ReportHost(ctx context.Context) (string, error)
	Close() error
	CloneInProgress(ctx context.Context) (bool, error)
	NeedsClone(ctx context.Context, donor string, port int32) (bool, error)
	Clone(ctx context.Context, donor, user, pass string, port int32) error
	IsReplica(ctx context.Context) (bool, error)
	DumbQuery(ctx context.Context) error
	GetGlobal(ctx context.Context, variable string) (interface{}, error)
	SetGlobal(ctx context.Context, variable, value interface{}) error
	StartGroupReplication(ctx context.Context, password string) error
	StopGroupReplication(ctx context.Context) error
	GetGroupReplicationPrimary(ctx context.Context) (string, error)
	GetGroupReplicationReplicas(ctx context.Context) ([]string, error)
	GetMemberState(ctx context.Context, host string) (MemberState, error)
	GetGroupReplicationMembers(ctx context.Context) ([]string, error)
	CheckIfDatabaseExists(ctx context.Context, name string) (bool, error)
	CheckIfInPrimaryPartition(ctx context.Context) (bool, error)
	CheckIfPrimaryUnreachable(ctx context.Context) (bool, error)
}

func NewReplicator

func NewReplicator(ctx context.Context, user apiv1alpha1.SystemUser, pass, host string, port int32) (Replicator, error)

func NewReplicatorExec added in v0.6.0

func NewReplicatorExec(pod *corev1.Pod, cliCmd clientcmd.Client, user apiv1alpha1.SystemUser, pass, host string) (Replicator, error)

Jump to

Keyboard shortcuts

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