Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultLogger ¶ added in v0.15.0
SetDefaultLogger sets the default logger used by the clustering package. The default logger is not normally used. It is used when another logger is not set in context due to testing or programming errors.
Types ¶
type AgentConn ¶
type AgentConn interface { agent.AgentClient io.Closer }
AgentConn represents a gRPC connection to a moco-agent
type AgentFactory ¶
type AgentFactory interface {
New(ctx context.Context, cluster *mocov1beta2.MySQLCluster, index int) (AgentConn, error)
}
AgentFactory represents the interface of a factory to create AgentConn
func NewAgentFactory ¶
func NewAgentFactory(r dbop.Resolver, reloader *cert.Reloader) AgentFactory
NewAgentFactory returns a new AgentFactory.
type ClusterManager ¶
type ClusterManager interface { Update(types.NamespacedName, string) UpdateNoStart(types.NamespacedName, string) Stop(types.NamespacedName) StopAll() }
ClusterManager represents the interface to manage goroutines to maintain MySQL clusters.
A goroutine for a MySQLCluster is started when `Update` method is called for the first time, and stops when `Stop` is called. Internally, context.Context is used to stop the goroutine.
This interface is meant to be used by MySQLClusterReconciler.
func NewClusterManager ¶
func NewClusterManager(interval time.Duration, m manager.Manager, opf dbop.OperatorFactory, af AgentFactory, log logr.Logger) ClusterManager
type ClusterState ¶
type ClusterState int
ClusterState represents the state of a MySQL cluster. Consult docs/clustering.md for details.
const ( StateUndecided ClusterState = iota StateIncomplete StateHealthy StateCloning StateRestoring StateDegraded StateFailed StateLost )
List of possible ClusterState.
func (ClusterState) String ¶
func (s ClusterState) String() string
String returns a unique string for each ClusterState.
type StatusSet ¶
type StatusSet struct { Primary int Cluster *mocov1beta2.MySQLCluster Password *password.MySQLPassword Pods []*corev1.Pod DBOps []dbop.Operator MySQLStatus []*dbop.MySQLInstanceStatus ExecutedGTID string Errants []int Candidates []int NeedSwitch bool Candidate int State ClusterState }
StatusSet represents the set of information to determine the ClusterState and later operations.
func (*StatusSet) DecideState ¶
func (ss *StatusSet) DecideState()
DecideState decides the ClusterState and set it to `ss.State`. It may also set `ss.NeedSwitch` and `ss.Candidate` for switchover.