Documentation ¶
Overview ¶
Copyright 2021 SANGFOR TECHNOLOGIES
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Mysql
- func (m *Mysql) BaseInfo() string
- func (m *Mysql) CanReplicateFrom(first dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor) (bool, error)
- func (m *Mysql) CascadeInfo() string
- func (m *Mysql) CategorizeReplication(topologyRecovery *dtstruct.TopologyRecovery, ...) ([]dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, ...)
- func (m *Mysql) ChangeMasterTo(instanceKey *dtstruct.InstanceKey, masterKey *dtstruct.InstanceKey, ...) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) CheckAndRecoverDeadMaster(analysisEntry dtstruct.ReplicationAnalysis, ...) (recoveryAttempted bool, topologyRecovery *dtstruct.TopologyRecovery, err error)
- func (m *Mysql) CheckIfWouldBeMaster(instance dtstruct.InstanceAdaptor) bool
- func (m *Mysql) CliCmd(commandMap map[string]dtstruct.CommandDesc, cliParam *dtstruct.CliParam)
- func (m *Mysql) DelayReplication(instanceKey *dtstruct.InstanceKey, seconds int) error
- func (m *Mysql) DetachMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) DriveName() string
- func (m *Mysql) EmptyCommitInstance(instanceKey *dtstruct.InstanceKey) error
- func (m *Mysql) ExecSQLOnInstance(instanceKey *dtstruct.InstanceKey, query string, args ...interface{}) (sql.Result, error)
- func (m *Mysql) ForgetInstance(instanceKey *dtstruct.InstanceKey) error
- func (m *Mysql) GetCandidateReplica(masterKey *dtstruct.InstanceKey, forRematchPurposes bool) (dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, ...)
- func (m *Mysql) GetCheckAndRecoverFunction(analysisCode dtstruct.AnalysisCode, analyzedInstanceKey *dtstruct.InstanceKey) (...)
- func (m *Mysql) GetDBConnPool(uri string) (db *sql.DB, err error)
- func (m *Mysql) GetDBURI(host string, port int, args ...interface{}) string
- func (m *Mysql) GetInfoFromInstance(ctx context.Context, instanceKey *dtstruct.InstanceKey, ...) (inst dtstruct.InstanceAdaptor, err error)
- func (m *Mysql) GetMasterRecoveryType(analysis *dtstruct.ReplicationAnalysis) dtstruct.RecoveryType
- func (m *Mysql) GetReplicationAnalysis(clusterName, clusterId string, hints *dtstruct.ReplicationAnalysisHints) ([]dtstruct.ReplicationAnalysis, error)
- func (m *Mysql) GetSyncInfo(instanceKey *dtstruct.InstanceKey, bufferWrites bool, agent string) (interface{}, error)
- func (m *Mysql) GracefulMasterTakeover(clusterName string, designatedKey *dtstruct.InstanceKey, auto bool) (topologyRecovery *dtstruct.TopologyRecovery, ...)
- func (m *Mysql) IsSmallerBinlogFormat(binlogFormat string, otherBinlogFormat string) bool
- func (m *Mysql) KillQuery(instanceKey *dtstruct.InstanceKey, process int64) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MakeCoMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MakeLocalMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MakeMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MasterInfo() string
- func (m *Mysql) MatchBelow(instanceKey, otherKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
- func (m *Mysql) MatchUp(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
- func (m *Mysql) MatchUpReplicas(masterKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (m *Mysql) MoveBelow(instanceKey, siblingKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MoveEquivalent(instanceKey, otherKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MoveUp(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) MoveUpReplicas(instanceKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (m *Mysql) MultiMatchBelow(replicas []dtstruct.InstanceAdaptor, belowKey *dtstruct.InstanceKey, ...) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (m *Mysql) MultiMatchReplicas(masterKey *dtstruct.InstanceKey, belowKey *dtstruct.InstanceKey, ...) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (m *Mysql) OpenTopology(host string, port int, args ...interface{}) (*sql.DB, error)
- func (m *Mysql) ReadClusterInstances(clusterName string) ([]dtstruct.InstanceAdaptor, error)
- func (m *Mysql) ReadFromBackendDB(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, bool, error)
- func (m *Mysql) ReadInstanceByCondition(query string, condition string, args []interface{}, sort string) ([]dtstruct.InstanceAdaptor, error)
- func (m *Mysql) ReadReplicaInstances(masterKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error)
- func (m *Mysql) ReattachMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) RegisterAPIRequest() map[string][]interface{}
- func (m *Mysql) RegisterWebRequest() map[string][]interface{}
- func (m *Mysql) RegroupReplicas(masterKey *dtstruct.InstanceKey, returnReplicaEvenOnFailureToRegroup bool, ...) ([]dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, ...)
- func (m *Mysql) RelocateBelow(instanceKey, otherKey *dtstruct.InstanceKey) (interface{}, error)
- func (m *Mysql) RelocateReplicas(instanceKey, otherKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
- func (m *Mysql) RematchReplica(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
- func (m *Mysql) ReplicationConfirm(failedKey *dtstruct.InstanceKey, streamKey *dtstruct.InstanceKey, ...) bool
- func (m *Mysql) Repoint(instanceKey *dtstruct.InstanceKey, masterKey *dtstruct.InstanceKey, ...) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) RepointReplicasTo(instanceKey *dtstruct.InstanceKey, pattern string, ...) ([]dtstruct.InstanceAdaptor, error, []error)
- func (m *Mysql) ResetReplication(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) RestartReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
- func (m *Mysql) RowToInstance(rowMap sqlutil.RowMap) dtstruct.InstanceAdaptor
- func (m *Mysql) RunEmergentOperations(analysisEntry *dtstruct.ReplicationAnalysis)
- func (m *Mysql) SQLProblemArgs(args ...interface{}) []interface{}
- func (m *Mysql) SQLProblemCondition() string
- func (m *Mysql) SQLProblemQuery() string
- func (m *Mysql) ScanInstanceRow(instanceKey *dtstruct.InstanceKey, query string, dest ...interface{}) error
- func (m *Mysql) SchemaBase() []string
- func (m *Mysql) SchemaPatch() []string
- func (m *Mysql) SetReadOnly(instanceKey *dtstruct.InstanceKey, readOnly bool) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) SetSemiSyncOnDownstream(instanceKey *dtstruct.InstanceKey, enableReplica bool) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) SetSemiSyncOnUpstream(instanceKey *dtstruct.InstanceKey, enableMaster bool) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) SkipQuery(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) SlaveInfo() string
- func (m *Mysql) StartReplication(ctx context.Context, instanceKey *dtstruct.InstanceKey) (interface{}, error)
- func (m *Mysql) StopReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
- func (m *Mysql) StopReplicationNicely(instanceKey *dtstruct.InstanceKey, timeout time.Duration) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) TLSCheck(uri string) bool
- func (m *Mysql) TLSConfig(tlsConfig *tls.Config) error
- func (m *Mysql) TakeMaster(instanceKey *dtstruct.InstanceKey, allowTakingCoMaster bool) (dtstruct.InstanceAdaptor, error)
- func (m *Mysql) TakeSiblings(instanceKey *dtstruct.InstanceKey) (instance dtstruct.InstanceAdaptor, takenSiblings int, err error)
- func (m *Mysql) Topology(request *dtstruct.Request, historyTimestampPattern string, tabulated bool, ...) (result interface{}, err error)
- func (m2 *Mysql) WriteToBackendDB(ctx context.Context, instances []dtstruct.InstanceAdaptor, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mysql ¶
type Mysql struct { }
func (*Mysql) CanReplicateFrom ¶
func (m *Mysql) CanReplicateFrom(first dtstruct.InstanceAdaptor, other dtstruct.InstanceAdaptor) (bool, error)
func (*Mysql) CascadeInfo ¶
func (*Mysql) CategorizeReplication ¶
func (m *Mysql) CategorizeReplication(topologyRecovery *dtstruct.TopologyRecovery, failedInstanceKey *dtstruct.InstanceKey, promotedRepIsIdeal func(dtstruct.InstanceAdaptor, bool) bool) ([]dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error)
func (*Mysql) ChangeMasterTo ¶
func (m *Mysql) ChangeMasterTo(instanceKey *dtstruct.InstanceKey, masterKey *dtstruct.InstanceKey, masterBinlogCoordinates *dtstruct.LogCoordinates, skipUnresolve bool, gtidHint string) (dtstruct.InstanceAdaptor, error)
func (*Mysql) CheckAndRecoverDeadMaster ¶
func (m *Mysql) CheckAndRecoverDeadMaster(analysisEntry dtstruct.ReplicationAnalysis, candidateInstanceKey *dtstruct.InstanceKey, forceInstanceRecovery bool, skipProcesses bool) (recoveryAttempted bool, topologyRecovery *dtstruct.TopologyRecovery, err error)
func (*Mysql) CheckIfWouldBeMaster ¶
func (m *Mysql) CheckIfWouldBeMaster(instance dtstruct.InstanceAdaptor) bool
func (*Mysql) DelayReplication ¶
func (m *Mysql) DelayReplication(instanceKey *dtstruct.InstanceKey, seconds int) error
func (*Mysql) DetachMaster ¶
func (m *Mysql) DetachMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
DetachMaster detaches a replica from its master by corrupting the Master_Host (in such way that is reversible)
func (*Mysql) EmptyCommitInstance ¶
func (m *Mysql) EmptyCommitInstance(instanceKey *dtstruct.InstanceKey) error
func (*Mysql) ExecSQLOnInstance ¶
func (*Mysql) ForgetInstance ¶
func (m *Mysql) ForgetInstance(instanceKey *dtstruct.InstanceKey) error
func (*Mysql) GetCandidateReplica ¶
func (m *Mysql) GetCandidateReplica(masterKey *dtstruct.InstanceKey, forRematchPurposes bool) (dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, error)
func (*Mysql) GetCheckAndRecoverFunction ¶
func (m *Mysql) GetCheckAndRecoverFunction(analysisCode dtstruct.AnalysisCode, analyzedInstanceKey *dtstruct.InstanceKey) (checkAndRecoverFunction func(analysisEntry dtstruct.ReplicationAnalysis, candidateInstanceKey *dtstruct.InstanceKey, forceInstanceRecovery bool, skipProcesses bool) (recoveryAttempted bool, topologyRecovery *dtstruct.TopologyRecovery, err error), isActionableRecovery bool)
func (*Mysql) GetInfoFromInstance ¶
func (m *Mysql) GetInfoFromInstance(ctx context.Context, instanceKey *dtstruct.InstanceKey, checkOnly, bufferWrites bool, latency *stopwatch.NamedStopwatch, agent string) (inst dtstruct.InstanceAdaptor, err error)
func (*Mysql) GetMasterRecoveryType ¶
func (m *Mysql) GetMasterRecoveryType(analysis *dtstruct.ReplicationAnalysis) dtstruct.RecoveryType
func (*Mysql) GetReplicationAnalysis ¶
func (m *Mysql) GetReplicationAnalysis(clusterName, clusterId string, hints *dtstruct.ReplicationAnalysisHints) ([]dtstruct.ReplicationAnalysis, error)
func (*Mysql) GetSyncInfo ¶
func (*Mysql) GracefulMasterTakeover ¶
func (m *Mysql) GracefulMasterTakeover(clusterName string, designatedKey *dtstruct.InstanceKey, auto bool) (topologyRecovery *dtstruct.TopologyRecovery, promotedMasterCoordinates *dtstruct.LogCoordinates, err error)
func (*Mysql) IsSmallerBinlogFormat ¶
func (*Mysql) KillQuery ¶
func (m *Mysql) KillQuery(instanceKey *dtstruct.InstanceKey, process int64) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MakeCoMaster ¶
func (m *Mysql) MakeCoMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MakeLocalMaster ¶
func (m *Mysql) MakeLocalMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MakeMaster ¶
func (m *Mysql) MakeMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MasterInfo ¶
func (*Mysql) MatchBelow ¶
func (m *Mysql) MatchBelow(instanceKey, otherKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
func (*Mysql) MatchUp ¶
func (m *Mysql) MatchUp(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
func (*Mysql) MatchUpReplicas ¶
func (m *Mysql) MatchUpReplicas(masterKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (*Mysql) MoveBelow ¶
func (m *Mysql) MoveBelow(instanceKey, siblingKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MoveEquivalent ¶
func (m *Mysql) MoveEquivalent(instanceKey, otherKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MoveUp ¶
func (m *Mysql) MoveUp(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) MoveUpReplicas ¶
func (m *Mysql) MoveUpReplicas(instanceKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (*Mysql) MultiMatchBelow ¶
func (m *Mysql) MultiMatchBelow(replicas []dtstruct.InstanceAdaptor, belowKey *dtstruct.InstanceKey, postponedFunctionsContainer *dtstruct.PostponedFunctionsContainer) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (*Mysql) MultiMatchReplicas ¶
func (m *Mysql) MultiMatchReplicas(masterKey *dtstruct.InstanceKey, belowKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (*Mysql) OpenTopology ¶
func (*Mysql) ReadClusterInstances ¶
func (m *Mysql) ReadClusterInstances(clusterName string) ([]dtstruct.InstanceAdaptor, error)
func (*Mysql) ReadFromBackendDB ¶
func (m *Mysql) ReadFromBackendDB(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, bool, error)
func (*Mysql) ReadInstanceByCondition ¶
func (*Mysql) ReadReplicaInstances ¶
func (m *Mysql) ReadReplicaInstances(masterKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error)
func (*Mysql) ReattachMaster ¶
func (m *Mysql) ReattachMaster(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
ReattachMaster reattaches a replica back onto its master by undoing a DetachMaster operation
func (*Mysql) RegisterAPIRequest ¶
func (*Mysql) RegisterWebRequest ¶
func (*Mysql) RegroupReplicas ¶
func (m *Mysql) RegroupReplicas(masterKey *dtstruct.InstanceKey, returnReplicaEvenOnFailureToRegroup bool, onCandidateReplicaChosen func(dtstruct.InstanceAdaptor), postponedFunctionsContainer *dtstruct.PostponedFunctionsContainer) ([]dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, []dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error)
func (*Mysql) RelocateBelow ¶
func (m *Mysql) RelocateBelow(instanceKey, otherKey *dtstruct.InstanceKey) (interface{}, error)
func (*Mysql) RelocateReplicas ¶
func (m *Mysql) RelocateReplicas(instanceKey, otherKey *dtstruct.InstanceKey, pattern string) ([]dtstruct.InstanceAdaptor, dtstruct.InstanceAdaptor, error, []error)
func (*Mysql) RematchReplica ¶
func (m *Mysql) RematchReplica(instanceKey *dtstruct.InstanceKey, requireInstanceMaintenance bool) (dtstruct.InstanceAdaptor, *dtstruct.LogCoordinates, error)
func (*Mysql) ReplicationConfirm ¶
func (m *Mysql) ReplicationConfirm(failedKey *dtstruct.InstanceKey, streamKey *dtstruct.InstanceKey, upstream bool) bool
func (*Mysql) Repoint ¶
func (m *Mysql) Repoint(instanceKey *dtstruct.InstanceKey, masterKey *dtstruct.InstanceKey, gtidHint string) (dtstruct.InstanceAdaptor, error)
func (*Mysql) RepointReplicasTo ¶
func (m *Mysql) RepointReplicasTo(instanceKey *dtstruct.InstanceKey, pattern string, belowKey *dtstruct.InstanceKey) ([]dtstruct.InstanceAdaptor, error, []error)
func (*Mysql) ResetReplication ¶
func (m *Mysql) ResetReplication(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) RestartReplication ¶
func (m *Mysql) RestartReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
func (*Mysql) RowToInstance ¶
func (m *Mysql) RowToInstance(rowMap sqlutil.RowMap) dtstruct.InstanceAdaptor
readInstanceRow reads a single instance row from the ham4db backend database.
func (*Mysql) RunEmergentOperations ¶
func (m *Mysql) RunEmergentOperations(analysisEntry *dtstruct.ReplicationAnalysis)
func (*Mysql) SQLProblemArgs ¶
func (m *Mysql) SQLProblemArgs(args ...interface{}) []interface{}
func (*Mysql) SQLProblemCondition ¶
func (*Mysql) SQLProblemQuery ¶
func (*Mysql) ScanInstanceRow ¶
func (m *Mysql) ScanInstanceRow(instanceKey *dtstruct.InstanceKey, query string, dest ...interface{}) error
func (*Mysql) SchemaBase ¶
func (*Mysql) SchemaPatch ¶
func (*Mysql) SetReadOnly ¶
func (m *Mysql) SetReadOnly(instanceKey *dtstruct.InstanceKey, readOnly bool) (dtstruct.InstanceAdaptor, error)
func (*Mysql) SetSemiSyncOnDownstream ¶
func (m *Mysql) SetSemiSyncOnDownstream(instanceKey *dtstruct.InstanceKey, enableReplica bool) (dtstruct.InstanceAdaptor, error)
func (*Mysql) SetSemiSyncOnUpstream ¶
func (m *Mysql) SetSemiSyncOnUpstream(instanceKey *dtstruct.InstanceKey, enableMaster bool) (dtstruct.InstanceAdaptor, error)
func (*Mysql) SkipQuery ¶
func (m *Mysql) SkipQuery(instanceKey *dtstruct.InstanceKey) (dtstruct.InstanceAdaptor, error)
func (*Mysql) StartReplication ¶
func (*Mysql) StopReplication ¶
func (m *Mysql) StopReplication(instanceKey *dtstruct.InstanceKey) (interface{}, error)
func (*Mysql) StopReplicationNicely ¶
func (m *Mysql) StopReplicationNicely(instanceKey *dtstruct.InstanceKey, timeout time.Duration) (dtstruct.InstanceAdaptor, error)
func (*Mysql) TakeMaster ¶
func (m *Mysql) TakeMaster(instanceKey *dtstruct.InstanceKey, allowTakingCoMaster bool) (dtstruct.InstanceAdaptor, error)
func (*Mysql) TakeSiblings ¶
func (m *Mysql) TakeSiblings(instanceKey *dtstruct.InstanceKey) (instance dtstruct.InstanceAdaptor, takenSiblings int, err error)