Documentation ¶
Index ¶
- Variables
- func AuditOperation(auditType string, tabletAlias string, message string) error
- func EnableAuditSyslog() (err error)
- func ExecDBWriteFunc(f func() error) error
- func ExpireAudit() error
- func ExpireInstanceAnalysisChangelog() error
- func ExpireStaleInstanceBinlogCoordinates() error
- func ExpireTableData(tableName string, timestampColumn string) error
- func ForgetInstance(tabletAlias string) error
- func ForgetLongUnseenInstances() error
- func GetDatabaseState() (string, error)
- func GetDurabilityPolicy(keyspace string) (reparentutil.Durabler, error)
- func GetKeyspaceShardName(tabletAlias string) (keyspace string, shard string, err error)
- func InitializeTMC() tmclient.TabletManagerClient
- func InstanceIsForgotten(tabletAlias string) bool
- func MajorVersion(version string) []string
- func ReadInstanceClusterAttributes(instance *Instance) (err error)
- func ReadKeyspace(keyspaceName string) (*topo.KeyspaceInfo, error)
- func ReadOutdatedInstanceKeys() ([]string, error)
- func ReadShardPrimaryInformation(keyspaceName, shardName string) (primaryAlias string, primaryTimestamp string, err error)
- func ReadTablet(tabletAlias string) (*topodatapb.Tablet, error)
- func RegisterStats()
- func SaveKeyspace(keyspace *topo.KeyspaceInfo) error
- func SaveShard(shard *topo.ShardInfo) error
- func SaveTablet(tablet *topodatapb.Tablet) error
- func SnapshotTopologies() error
- func UpdateInstanceLastAttemptedCheck(tabletAlias string) error
- func UpdateInstanceLastChecked(tabletAlias string, partialSuccess bool) error
- func ValidSecondsFromSeenToLastAttemptedCheck() uint
- func WriteInstance(instance *Instance, instanceWasActuallyFound bool, lastError error) error
- type AnalysisCode
- type BinlogCoordinates
- func (binlogCoordinates *BinlogCoordinates) Detach() (detachedCoordinates BinlogCoordinates)
- func (binlogCoordinates *BinlogCoordinates) DisplayString() string
- func (binlogCoordinates *BinlogCoordinates) Equals(other *BinlogCoordinates) bool
- func (binlogCoordinates *BinlogCoordinates) ExtractDetachedCoordinates() (isDetached bool, detachedCoordinates BinlogCoordinates)
- func (binlogCoordinates *BinlogCoordinates) FileNumber() (int, int)
- func (binlogCoordinates *BinlogCoordinates) FileNumberDistance(other *BinlogCoordinates) int
- func (binlogCoordinates *BinlogCoordinates) FileSmallerThan(other *BinlogCoordinates) bool
- func (binlogCoordinates *BinlogCoordinates) IsEmpty() bool
- func (binlogCoordinates *BinlogCoordinates) NextFileCoordinates() (BinlogCoordinates, error)
- func (binlogCoordinates *BinlogCoordinates) PreviousFileCoordinates() (BinlogCoordinates, error)
- func (binlogCoordinates *BinlogCoordinates) PreviousFileCoordinatesBy(offset int) (BinlogCoordinates, error)
- func (binlogCoordinates *BinlogCoordinates) SmallerThan(other *BinlogCoordinates) bool
- func (binlogCoordinates *BinlogCoordinates) SmallerThanOrEquals(other *BinlogCoordinates) bool
- func (binlogCoordinates BinlogCoordinates) String() string
- type BinlogType
- type ClusterInfo
- type Instance
- func NewInstance() *Instance
- func ReadInstance(tabletAlias string) (*Instance, bool, error)
- func ReadInstancesWithErrantGTIds(keyspace string, shard string) ([]*Instance, error)
- func ReadProblemInstances(keyspace string, shard string) ([](*Instance), error)
- func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.NamedStopwatch) (inst *Instance, err error)
- func (instance *Instance) Equals(other *Instance) bool
- func (instance *Instance) FlavorNameAndMajorVersion() string
- func (instance *Instance) IsBinlogServer() bool
- func (instance *Instance) IsMariaDB() bool
- func (instance *Instance) IsOracleMySQL() bool
- func (instance *Instance) IsPercona() bool
- func (instance *Instance) IsPrimary() bool
- func (instance *Instance) IsReplica() bool
- func (instance *Instance) MajorVersion() []string
- func (instance *Instance) MajorVersionString() string
- func (instance *Instance) MarshalJSON() ([]byte, error)
- func (instance *Instance) ReplicaRunning() bool
- func (instance *Instance) ReplicationThreadsExist() bool
- func (instance *Instance) ReplicationThreadsStopped() bool
- func (instance *Instance) SQLThreadUpToDate() bool
- func (instance *Instance) UsingGTID() bool
- type OracleGtidSet
- type OracleGtidSetEntry
- type PeerAnalysisMap
- type ReplicationAnalysis
- type ReplicationAnalysisHints
- type ReplicationThreadState
- type StructureAnalysisCode
Constants ¶
This section is empty.
Variables ¶
var ErrKeyspaceNotFound = errors.New("keyspace not found")
ErrKeyspaceNotFound is a fixed error message used when a keyspace is not found in the database.
var ErrShardNotFound = errors.New("shard not found")
ErrShardNotFound is a fixed error message used when a shard is not found in the database.
var ErrTabletAliasNil = errors.New("tablet alias is nil")
ErrTabletAliasNil is a fixed error message.
Functions ¶
func AuditOperation ¶
AuditOperation creates and writes a new audit entry by given params
func EnableAuditSyslog ¶
func EnableAuditSyslog() (err error)
EnableAuditSyslog enables, if possible, writes to syslog. These will execute _in addition_ to normal logging
func ExecDBWriteFunc ¶
ExecDBWriteFunc chooses how to execute a write onto the database: whether synchronously or not
func ExpireInstanceAnalysisChangelog ¶
func ExpireInstanceAnalysisChangelog() error
ExpireInstanceAnalysisChangelog removes old-enough analysis entries from the changelog
func ExpireStaleInstanceBinlogCoordinates ¶
func ExpireStaleInstanceBinlogCoordinates() error
func ExpireTableData ¶
func ForgetInstance ¶
ForgetInstance removes an instance entry from the vtorc backed database. It may be auto-rediscovered through topology or requested for discovery by multiple means.
func ForgetLongUnseenInstances ¶
func ForgetLongUnseenInstances() error
ForgetLongUnseenInstances will remove entries of all instances that have long since been last seen.
func GetDatabaseState ¶ added in v0.20.0
GetDatabaseState takes the snapshot of the database and returns it.
func GetDurabilityPolicy ¶
func GetDurabilityPolicy(keyspace string) (reparentutil.Durabler, error)
GetDurabilityPolicy gets the durability policy for the given keyspace.
func GetKeyspaceShardName ¶ added in v0.16.0
GetKeyspaceShardName gets the keyspace shard name for the given instance key
func InitializeTMC ¶ added in v0.19.4
func InitializeTMC() tmclient.TabletManagerClient
InitializeTMC initializes the tablet manager client to use for all VTOrc RPC calls.
func InstanceIsForgotten ¶
func MajorVersion ¶
MajorVersion returns a MySQL major version number (e.g. given "5.5.36" it returns "5.5")
func ReadInstanceClusterAttributes ¶
ReadInstanceClusterAttributes will return the cluster name for a given instance by looking at its primary and getting it from there. It is a non-recursive function and so-called-recursion is performed upon periodic reading of instances.
func ReadKeyspace ¶
func ReadKeyspace(keyspaceName string) (*topo.KeyspaceInfo, error)
ReadKeyspace reads the vitess keyspace record.
func ReadOutdatedInstanceKeys ¶
ReadOutdatedInstanceKeys reads and returns keys for all instances that are not up to date (i.e. pre-configured time has passed since they were last checked) or the ones whose tablet information was read but not the mysql information. This could happen if the durability policy of the keyspace wasn't available at the time it was discovered. This would lead to not having the record of the tablet in the database_instance table. We also check for the case where an attempt at instance checking has been made, that hasn't resulted in an actual check! This can happen when TCP/IP connections are hung, in which case the "check" never returns. In such case we multiply interval by a factor, so as not to open too many connections on the instance.
func ReadShardPrimaryInformation ¶ added in v0.18.0
func ReadShardPrimaryInformation(keyspaceName, shardName string) (primaryAlias string, primaryTimestamp string, err error)
ReadShardPrimaryInformation reads the vitess shard record and gets the shard primary alias and timestamp.
func ReadTablet ¶
func ReadTablet(tabletAlias string) (*topodatapb.Tablet, error)
ReadTablet reads the vitess tablet record.
func RegisterStats ¶ added in v0.18.0
func RegisterStats()
RegisterStats registers stats from the inst package
func SaveKeyspace ¶
func SaveKeyspace(keyspace *topo.KeyspaceInfo) error
SaveKeyspace saves the keyspace record against the keyspace name.
func SaveTablet ¶
func SaveTablet(tablet *topodatapb.Tablet) error
SaveTablet saves the tablet record against the instanceKey.
func SnapshotTopologies ¶
func SnapshotTopologies() error
SnapshotTopologies records topology graph for all existing topologies
func UpdateInstanceLastAttemptedCheck ¶
UpdateInstanceLastAttemptedCheck updates the last_attempted_check timestamp in the vtorc backed database for a given instance. This is used as a failsafe mechanism in case access to the instance gets hung (it happens), in which case the entire ReadTopology gets stuck (and no, connection timeout nor driver timeouts don't help. Don't look at me, the world is a harsh place to live in). And so we make sure to note down *before* we even attempt to access the instance; and this raises a red flag when we wish to access the instance again: if last_attempted_check is *newer* than last_checked, that's bad news and means we have a "hanging" issue.
func UpdateInstanceLastChecked ¶
UpdateInstanceLastChecked updates the last_check timestamp in the vtorc backed database for a given instance
func ValidSecondsFromSeenToLastAttemptedCheck ¶
func ValidSecondsFromSeenToLastAttemptedCheck() uint
ValidSecondsFromSeenToLastAttemptedCheck returns the maximum allowed elapsed time between last_attempted_check to last_checked before we consider the instance as invalid.
Types ¶
type AnalysisCode ¶
type AnalysisCode string
const ( NoProblem AnalysisCode = "NoProblem" ClusterHasNoPrimary AnalysisCode = "ClusterHasNoPrimary" PrimaryTabletDeleted AnalysisCode = "PrimaryTabletDeleted" InvalidPrimary AnalysisCode = "InvalidPrimary" InvalidReplica AnalysisCode = "InvalidReplica" DeadPrimaryWithoutReplicas AnalysisCode = "DeadPrimaryWithoutReplicas" DeadPrimary AnalysisCode = "DeadPrimary" DeadPrimaryAndReplicas AnalysisCode = "DeadPrimaryAndReplicas" DeadPrimaryAndSomeReplicas AnalysisCode = "DeadPrimaryAndSomeReplicas" PrimaryHasPrimary AnalysisCode = "PrimaryHasPrimary" PrimaryIsReadOnly AnalysisCode = "PrimaryIsReadOnly" PrimarySemiSyncMustBeSet AnalysisCode = "PrimarySemiSyncMustBeSet" PrimarySemiSyncMustNotBeSet AnalysisCode = "PrimarySemiSyncMustNotBeSet" ReplicaIsWritable AnalysisCode = "ReplicaIsWritable" NotConnectedToPrimary AnalysisCode = "NotConnectedToPrimary" ConnectedToWrongPrimary AnalysisCode = "ConnectedToWrongPrimary" ReplicationStopped AnalysisCode = "ReplicationStopped" ReplicaSemiSyncMustBeSet AnalysisCode = "ReplicaSemiSyncMustBeSet" ReplicaSemiSyncMustNotBeSet AnalysisCode = "ReplicaSemiSyncMustNotBeSet" ReplicaMisconfigured AnalysisCode = "ReplicaMisconfigured" UnreachablePrimaryWithLaggingReplicas AnalysisCode = "UnreachablePrimaryWithLaggingReplicas" UnreachablePrimary AnalysisCode = "UnreachablePrimary" PrimarySingleReplicaNotReplicating AnalysisCode = "PrimarySingleReplicaNotReplicating" PrimarySingleReplicaDead AnalysisCode = "PrimarySingleReplicaDead" AllPrimaryReplicasNotReplicating AnalysisCode = "AllPrimaryReplicasNotReplicating" AllPrimaryReplicasNotReplicatingOrDead AnalysisCode = "AllPrimaryReplicasNotReplicatingOrDead" LockedSemiSyncPrimaryHypothesis AnalysisCode = "LockedSemiSyncPrimaryHypothesis" LockedSemiSyncPrimary AnalysisCode = "LockedSemiSyncPrimary" ErrantGTIDDetected AnalysisCode = "ErrantGTIDDetected" )
type BinlogCoordinates ¶
type BinlogCoordinates struct { LogFile string LogPos uint32 Type BinlogType }
BinlogCoordinates described binary log coordinates in the form of log file & log position.
func ParseBinlogCoordinates ¶
func ParseBinlogCoordinates(logFileLogPos string) (*BinlogCoordinates, error)
ParseInstanceKey will parse an InstanceKey from a string representation such as 127.0.0.1:3306
func (*BinlogCoordinates) Detach ¶
func (binlogCoordinates *BinlogCoordinates) Detach() (detachedCoordinates BinlogCoordinates)
Detach returns a detached form of coordinates
func (*BinlogCoordinates) DisplayString ¶
func (binlogCoordinates *BinlogCoordinates) DisplayString() string
DisplayString returns a user-friendly string representation of these coordinates
func (*BinlogCoordinates) Equals ¶
func (binlogCoordinates *BinlogCoordinates) Equals(other *BinlogCoordinates) bool
Equals tests equality of this coordinate and another one.
func (*BinlogCoordinates) ExtractDetachedCoordinates ¶
func (binlogCoordinates *BinlogCoordinates) ExtractDetachedCoordinates() (isDetached bool, detachedCoordinates BinlogCoordinates)
FileSmallerThan returns true if this coordinate's file is strictly smaller than the other's.
func (*BinlogCoordinates) FileNumber ¶
func (binlogCoordinates *BinlogCoordinates) FileNumber() (int, int)
FileNumber returns the numeric value of the file, and the length in characters representing the number in the filename. Example: FileNumber() of mysqld.log.000789 is (789, 6)
func (*BinlogCoordinates) FileNumberDistance ¶
func (binlogCoordinates *BinlogCoordinates) FileNumberDistance(other *BinlogCoordinates) int
FileNumberDistance returns the numeric distance between this coordinate's file number and the other's. Effectively it means "how many rotates/FLUSHes would make these coordinates's file reach the other's"
func (*BinlogCoordinates) FileSmallerThan ¶
func (binlogCoordinates *BinlogCoordinates) FileSmallerThan(other *BinlogCoordinates) bool
FileSmallerThan returns true if this coordinate's file is strictly smaller than the other's.
func (*BinlogCoordinates) IsEmpty ¶
func (binlogCoordinates *BinlogCoordinates) IsEmpty() bool
IsEmpty returns true if the log file is empty, unnamed
func (*BinlogCoordinates) NextFileCoordinates ¶
func (binlogCoordinates *BinlogCoordinates) NextFileCoordinates() (BinlogCoordinates, error)
PreviousFileCoordinates guesses the filename of the previous binlog/relaylog
func (*BinlogCoordinates) PreviousFileCoordinates ¶
func (binlogCoordinates *BinlogCoordinates) PreviousFileCoordinates() (BinlogCoordinates, error)
PreviousFileCoordinates guesses the filename of the previous binlog/relaylog
func (*BinlogCoordinates) PreviousFileCoordinatesBy ¶
func (binlogCoordinates *BinlogCoordinates) PreviousFileCoordinatesBy(offset int) (BinlogCoordinates, error)
PreviousFileCoordinatesBy guesses the filename of the previous binlog/relaylog, by given offset (number of files back)
func (*BinlogCoordinates) SmallerThan ¶
func (binlogCoordinates *BinlogCoordinates) SmallerThan(other *BinlogCoordinates) bool
SmallerThan returns true if this coordinate is strictly smaller than the other.
func (*BinlogCoordinates) SmallerThanOrEquals ¶
func (binlogCoordinates *BinlogCoordinates) SmallerThanOrEquals(other *BinlogCoordinates) bool
SmallerThanOrEquals returns true if this coordinate is the same or equal to the other one. We do NOT compare the type so we can not use this.Equals()
func (BinlogCoordinates) String ¶
func (binlogCoordinates BinlogCoordinates) String() string
String returns a user-friendly string representation of these coordinates
type ClusterInfo ¶
ClusterInfo makes for a cluster status/info summary
type Instance ¶
type Instance struct { Hostname string Port int InstanceAlias string ServerID uint ServerUUID string Version string VersionComment string FlavorName string ReadOnly bool BinlogFormat string BinlogRowImage string LogBinEnabled bool LogReplicationUpdatesEnabled bool SelfBinlogCoordinates BinlogCoordinates SourceHost string SourcePort int SourceUUID string AncestryUUID string ReplicaNetTimeout int32 HeartbeatInterval float64 ReplicationSQLThreadRuning bool ReplicationIOThreadRuning bool ReplicationSQLThreadState ReplicationThreadState ReplicationIOThreadState ReplicationThreadState HasReplicationFilters bool GTIDMode string SupportsOracleGTID bool UsingOracleGTID bool UsingMariaDBGTID bool UsingPseudoGTID bool // Legacy. Always 'false' ReadBinlogCoordinates BinlogCoordinates ExecBinlogCoordinates BinlogCoordinates IsDetached bool RelaylogCoordinates BinlogCoordinates LastSQLError string LastIOError string SecondsBehindPrimary sql.NullInt64 SQLDelay uint32 ExecutedGtidSet string GtidPurged string GtidErrant string ReplicationLagSeconds sql.NullInt64 DataCenter string Region string PhysicalEnvironment string ReplicationDepth uint IsCoPrimary bool HasReplicationCredentials bool SemiSyncEnforced bool SemiSyncPrimaryEnabled bool SemiSyncReplicaEnabled bool SemiSyncPrimaryTimeout uint64 SemiSyncPrimaryWaitForReplicaCount uint SemiSyncPrimaryStatus bool SemiSyncPrimaryClients uint SemiSyncReplicaStatus bool LastSeenTimestamp string IsLastCheckValid bool IsUpToDate bool IsRecentlyChecked bool SecondsSinceLastSeen sql.NullInt64 AllowTLS bool Problems []string LastDiscoveryLatency time.Duration // contains filtered or unexported fields }
Instance represents a database instance, including its current configuration & status. It presents important replication configuration and detailed replication status.
func NewInstance ¶
func NewInstance() *Instance
func ReadInstance ¶
ReadInstance reads an instance from the vtorc backend database
func ReadInstancesWithErrantGTIds ¶ added in v0.18.0
ReadInstancesWithErrantGTIds reads all instances with errant GTIDs
func ReadProblemInstances ¶
ReadProblemInstances reads all instances with problems
func ReadTopologyInstanceBufferable ¶
func ReadTopologyInstanceBufferable(tabletAlias string, latency *stopwatch.NamedStopwatch) (inst *Instance, err error)
ReadTopologyInstanceBufferable connects to a topology MySQL instance and collects information on the server and its replication state. It writes the information retrieved into vtorc's backend. - writes are optionally buffered. - timing information can be collected for the stages performed.
func (*Instance) Equals ¶
Equals tests that this instance is the same instance as other. The function does not test configuration or status.
func (*Instance) FlavorNameAndMajorVersion ¶
FlavorNameAndMajorVersion returns a string of the combined flavor and major version which is useful in some checks.
func (*Instance) IsBinlogServer ¶
IsBinlogServer checks whether this is any type of a binlog server
func (*Instance) IsOracleMySQL ¶
IsOracleMySQL checks whether this is an Oracle MySQL distribution
func (*Instance) IsPrimary ¶
IsPrimary makes simple heuristics to decide whether this instance is a primary (not replicating from any other server), either via traditional async/semisync replication or group replication
func (*Instance) IsReplica ¶
IsReplica makes simple heuristics to decide whether this instance is a replica of another instance
func (*Instance) MajorVersion ¶
MajorVersion returns this instance's major version number (e.g. for 5.5.36 it returns "5.5")
func (*Instance) MajorVersionString ¶
MajorVersionString returns this instance's major version number (e.g. for 5.5.36 it returns "5.5")
func (*Instance) MarshalJSON ¶
func (*Instance) ReplicaRunning ¶
ReplicaRunning returns true when this instance's status is of a replicating replica.
func (*Instance) ReplicationThreadsExist ¶
NoReplicationThreadRunning returns true when neither SQL nor IO threads are running (including the case where isn't even a replica)
func (*Instance) ReplicationThreadsStopped ¶
NoReplicationThreadRunning returns true when neither SQL nor IO threads are running (including the case where isn't even a replica)
func (*Instance) SQLThreadUpToDate ¶
SQLThreadUpToDate returns true when the instance had consumed all relay logs.
type OracleGtidSet ¶
type OracleGtidSet struct {
GtidEntries []*OracleGtidSetEntry
}
OracleGtidSet represents a set of GTID ranges as depicted by Retrieved_Gtid_Set, Executed_Gtid_Set or @@gtid_purged.
func NewOracleGtidSet ¶
func NewOracleGtidSet(gtidSet string) (res *OracleGtidSet, err error)
NewOracleGtidSet creates a new GTID set. Example input: `230ea8ea-81e3-11e4-972a-e25ec4bd140a:1-10539, 316d193c-70e5-11e5-adb2-ecf4bb2262ff:1-8935:8984-6124596, 321f5c0d-70e5-11e5-adb2-ecf4bb2262ff:1-56`
func (*OracleGtidSet) IsEmpty ¶
func (oracleGTIDSet *OracleGtidSet) IsEmpty() bool
func (*OracleGtidSet) RemoveUUID ¶
func (oracleGTIDSet *OracleGtidSet) RemoveUUID(uuid string) (removed bool)
RemoveUUID removes entries that belong to given UUID. By way of how this works there can only be one entry matching our UUID, but we generalize. We keep order of entries.
func (*OracleGtidSet) String ¶
func (oracleGTIDSet *OracleGtidSet) String() string
type OracleGtidSetEntry ¶
OracleGtidSetEntry represents an entry in a set of GTID ranges, for example, the entry: "316d193c-70e5-11e5-adb2-ecf4bb2262ff:1-8935:8984-6124596" (may include gaps)
func NewOracleGtidSetEntry ¶
func NewOracleGtidSetEntry(gtidRangeString string) (*OracleGtidSetEntry, error)
NewOracleGtidSetEntry parses a single entry text
func (*OracleGtidSetEntry) String ¶
func (oracleGTIDSetEntry *OracleGtidSetEntry) String() string
String returns a user-friendly string representation of this entry
type PeerAnalysisMap ¶
PeerAnalysisMap indicates the number of peers agreeing on an analysis. Key of this map is a InstanceAnalysis.String()
type ReplicationAnalysis ¶
type ReplicationAnalysis struct { AnalyzedInstanceAlias string AnalyzedInstancePrimaryAlias string TabletType topodatapb.TabletType PrimaryTimeStamp time.Time ClusterDetails ClusterInfo AnalyzedKeyspace string AnalyzedShard string // ShardPrimaryTermTimestamp is the primary term start time stored in the shard record. ShardPrimaryTermTimestamp string AnalyzedInstanceBinlogCoordinates BinlogCoordinates IsPrimary bool IsClusterPrimary bool LastCheckValid bool LastCheckPartialSuccess bool CountReplicas uint CountValidReplicas uint CountValidReplicatingReplicas uint ReplicationStopped bool ErrantGTID string ReplicaNetTimeout int32 HeartbeatInterval float64 Analysis AnalysisCode Description string StructureAnalysis []StructureAnalysisCode OracleGTIDImmediateTopology bool MariaDBGTIDImmediateTopology bool BinlogServerImmediateTopology bool SemiSyncPrimaryEnabled bool SemiSyncPrimaryStatus bool SemiSyncPrimaryWaitForReplicaCount uint SemiSyncPrimaryClients uint SemiSyncReplicaEnabled bool CountSemiSyncReplicasEnabled uint CountLoggingReplicas uint CountStatementBasedLoggingReplicas uint CountMixedBasedLoggingReplicas uint CountRowBasedLoggingReplicas uint CountDistinctMajorVersionsLoggingReplicas uint CountDelayedReplicas uint CountLaggingReplicas uint IsActionableRecovery bool RecoveryId int64 GTIDMode string MinReplicaGTIDMode string MaxReplicaGTIDMode string MaxReplicaGTIDErrant string IsReadOnly bool }
ReplicationAnalysis notes analysis on replication chain status, per instance
func GetReplicationAnalysis ¶
func GetReplicationAnalysis(keyspace string, shard string, hints *ReplicationAnalysisHints) ([]*ReplicationAnalysis, error)
GetReplicationAnalysis will check for replication problems (dead primary; unreachable primary; etc)
func (*ReplicationAnalysis) MarshalJSON ¶
func (replicationAnalysis *ReplicationAnalysis) MarshalJSON() ([]byte, error)
type ReplicationAnalysisHints ¶
type ReplicationAnalysisHints struct {
AuditAnalysis bool
}
type ReplicationThreadState ¶
type ReplicationThreadState int
const ( ReplicationThreadStateNoThread ReplicationThreadState = -1 ReplicationThreadStateStopped ReplicationThreadState = 0 ReplicationThreadStateRunning ReplicationThreadState = 1 ReplicationThreadStateOther ReplicationThreadState = 2 )
func ReplicationThreadStateFromReplicationState ¶
func ReplicationThreadStateFromReplicationState(state replication.ReplicationState) ReplicationThreadState
ReplicationThreadStateFromReplicationState gets the replication thread state from replication state TODO: Merge these two into one
func (*ReplicationThreadState) Exists ¶
func (replicationThreadState *ReplicationThreadState) Exists() bool
func (*ReplicationThreadState) IsRunning ¶
func (replicationThreadState *ReplicationThreadState) IsRunning() bool
func (*ReplicationThreadState) IsStopped ¶
func (replicationThreadState *ReplicationThreadState) IsStopped() bool
type StructureAnalysisCode ¶
type StructureAnalysisCode string
const ( StatementAndMixedLoggingReplicasStructureWarning StructureAnalysisCode = "StatementAndMixedLoggingReplicasStructureWarning" StatementAndRowLoggingReplicasStructureWarning StructureAnalysisCode = "StatementAndRowLoggingReplicasStructureWarning" MixedAndRowLoggingReplicasStructureWarning StructureAnalysisCode = "MixedAndRowLoggingReplicasStructureWarning" MultipleMajorVersionsLoggingReplicasStructureWarning StructureAnalysisCode = "MultipleMajorVersionsLoggingReplicasStructureWarning" NoLoggingReplicasStructureWarning StructureAnalysisCode = "NoLoggingReplicasStructureWarning" DifferentGTIDModesStructureWarning StructureAnalysisCode = "DifferentGTIDModesStructureWarning" ErrantGTIDStructureWarning StructureAnalysisCode = "ErrantGTIDStructureWarning" NoFailoverSupportStructureWarning StructureAnalysisCode = "NoFailoverSupportStructureWarning" NoWriteablePrimaryStructureWarning StructureAnalysisCode = "NoWriteablePrimaryStructureWarning" NotEnoughValidSemiSyncReplicasStructureWarning StructureAnalysisCode = "NotEnoughValidSemiSyncReplicasStructureWarning" )