package
3.0.3+incompatible
Repository: https://github.com/cloudmode/orchestrator.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
AreReplicationThreadsRunning checks if both IO and SQL threads are running.
ASCIITopology returns a string representation of the topology of given cluster.
AuditOperation creates and writes a new audit entry by given params.
BeginBoundedMaintenance will make new maintenance entry for given instanceKey.
BeginDowntime will make mark an instance as downtimed (or override existing downtime period).
BeginMaintenance will make new maintenance entry for given instanceKey.
BulkReadCandidateDatabaseInstance returns a slice of CandidateDatabaseInstance converted to JSON.
BulkReadInstance returns a list of all instances from the database - I only need the Hostname and Port fields.
ChangeMasterCredentials issues a CHANGE MASTER TO..
ChangeMasterTo changes the given instance's master according to given input.
CorrelateBinlogCoordinates find out, if possible, the binlog coordinates of given otherInstance that correlate with given coordinates of given instance.
No description provided by the author
DeduceClusterName attempts to resolve a cluster name given a name or alias.
DeleteHostnameUnresolve removes an unresolve entry.
DeleteInvalidHostnameResolves removes invalid resolves.
DetachReplica detaches a replica from replication; forcibly corrupting the binlog coordinates (though in such way that is reversible).
DetachReplicaMasterHost detaches a replica from its master by corrupting the Master_Host (in such way that is reversible).
DetachReplicaOperation will detach a replica from its master by forcibly corrupting its replication coordinates.
DisableGTID will attempt to disable GTID-mode (either Oracle or MariaDB) and revert to binlog file:pos replication.
EmptyCommitInstance issues an empty COMMIT on a given instance.
EnableSyslogWriter enables, if possible, writes to syslog.
EnableGTID will attempt to enable GTID-mode (either Oracle or MariaDB).
EnableSemiSync sets the rpl_semi_sync_(master|slave)_enabled variables on a given instance.
EndDowntime will remove downtime flag from an instance.
EndMaintenance will terminate an active maintenance via maintenanceToken.
EndMaintenanceByInstanceKey will terminate an active maintenance using given instanceKey as hint.
ExecDBWriteFunc chooses how to execute a write onto the database: whether synchronuously or not.
ExecInstance executes a given query on the given MySQL topology instance.
ExecInstanceNoPrepare executes a given query on the given MySQL topology instance, without using prepared statements.
ExecuteOnTopology will execute given function while maintaining concurrency limit on topology servers.
ExpireAudit removes old rows from the audit table.
ExpireCandidateInstances removes stale master candidate suggestions.
ExpireClusterDomainName expires cluster_domain_name entries that haven't been updated recently.
ExpireDowntime will remove the maintenance flag on old downtimes.
ExpireHostnameUnresolve expires hostname_unresolve entries that haven't been updated recently.
ExpireInstanceAnalysisChangelog removes old-enough analysis entries from the changelog.
No description provided by the author
ExpireMaintenance will remove the maintenance flag on old maintenances and on bounded maintenances.
ExpireMasterPositionEquivalence expires old master_position_equivalence.
ExpirePoolInstances cleans up the database_instance_pool table from expired items.
No description provided by the author
FigureClusterName will make a best effort to deduce a cluster name using either a given alias or an instanceKey.
FigureInstanceKey tries to figure out a key.
FindFuzzyInstances return instances whose names are like the one given (host & port substrings) For example, the given `mydb-3:3306` might find `myhosts-mydb301-production.mycompany.com:3306`.
FindInstances reads all instances whose name matches given pattern.
FindLastPseudoGTIDEntry will search an instance's binary logs or relay logs for the last pseudo-GTID entry, and return found coordinates as well as entry text.
FlushBinaryLogs attempts a 'FLUSH BINARY LOGS' statement on the given instance.
FlushBinaryLogsTo attempts to 'FLUSH BINARY LOGS' until given binary log is reached.
No description provided by the author
ForgetInstance removes an instance entry from the orchestrator backed database.
ForgetExpiredHostnameResolves.
ForgetInstance removes an instance entry from the orchestrator backed database.
ForgetLongUnseenInstances will remove entries of all instacnes that have long since been last seen.
ForgetUnseenInstancesDifferentlyResolved will purge instances which are invalid, and whose hostname appears on the hostname_resolved table; this means some time in the past their hostname was unresovled, and now resovled to a different value; the old hostname is never accessed anymore and the old entry should be removed.
GetCandidateReplica chooses the best replica to promote given a (possibly dead) master.
GetCandidateReplicaOfBinlogServerTopology chooses the best replica to promote given a (possibly dead) master.
GetClusterByAlias returns the cluster name associated with given alias.
GetClusterGhostReplicas returns a list of replicas that can serve as the connected servers for a [gh-ost](https://github.com/github/gh-ost) operation.
GetClusterHeuristicLag returns a heuristic lag for a cluster, based on its OSC replicas.
No description provided by the author
No description provided by the author
No description provided by the author
GetClusterOSCReplicas returns a heuristic list of replicas which are fit as controll replicas for an OSC operation.
GetCNAME resolves an IP or hostname into a normalized valid CNAME.
No description provided by the author
No description provided by the author
GetHeuristicClusterDomainInstanceAttribute attempts detecting the cluster domain for the given cluster, and return the instance key associated as writer with that domain.
GetHeuristicClusterPoolInstances returns instances of a cluster which are also pooled.
GetHeuristicClusterPoolInstancesLag returns a heuristic lag for the instances participating in a cluster pool (or all the cluster's pools).
GetHeuristiclyRecentCoordinatesForInstance returns valid and reasonably recent coordinates for given instance.
GetInstanceMaster synchronously reaches into the replication topology and retrieves master's data.
GetInstancesMaxLag returns the maximum lag in a set of instances.
No description provided by the author
No description provided by the author
Get a listing of KVPair for clusters masters, for all clusters or for a specific cluster.
GetNextBinlogCoordinatesToMatch is given a twin-coordinates couple for a would-be replica (instance) and another instance (other).
GetPreviousKnownRelayLogCoordinatesForInstance returns known relay log coordinates, that are not the exact current coordinates.
GetReplicationAnalysis will check for replication problems (dead master; unreachable master; etc).
GetSlaveRestartPreserveStatements returns a sequence of statements that make sure a replica is stopped and then returned to the same state.
GetSortedReplicas reads list of replicas of a given master, and returns them sorted by exec coordinates (most up-to-date replica first).
HeuristicallyApplyClusterDomainInstanceAttribute writes down the cluster-domain to master-hostname as a general attribute, by reading current topology and **trusting** it to be correct.
No description provided by the author
No description provided by the author
InjectUnseenMasters will review masters of instances that are known to be replicating, yet which are not listed in database_instance.
No description provided by the author
InstanceIsMasterOf checks whether an instance is the master of another.
InstancesAreSiblings checks whether both instances are replicating from same master.
No description provided by the author
IsSmallerBinlogFormat tests two binlog formats and sees if one is "smaller" than the other.
IsSmallerMajorVersion tests two versions against another and returns true if the former is a smaller "major" varsion than the latter.
KillQuery stops replication on a given instance.
No description provided by the author
MajorVersion returns a MySQL major version number (e.g.
MakeCoMaster will attempt to make an instance co-master with its master, by making its master a replica of its own.
MakeLocalMaster promotes a replica above its master, making it replica of its grandparent, while also enslaving its siblings.
MakeMaster will take an instance, make all its siblings its replicas (via pseudo-GTID) and make it master (stop its replicaiton, make writeable).
MasterPosWait issues a MASTER_POS_WAIT() an given instance according to given coordinates.
MatchBelow will attempt moving instance indicated by instanceKey below its the one indicated by otherKey.
MatchUp will move a replica up the replication chain, so that it becomes sibling of its master, via Pseudo-GTID.
MatchUpReplicas will move all replicas of given master up the replication chain, so that they become siblings of their master.
MoveBelow will attempt moving instance indicated by instanceKey below its supposed sibling indicated by sinblingKey.
MoveBelowGTID will attempt moving instance indicated by instanceKey below another instance using either Oracle GTID or MariaDB GTID.
MoveEquivalent will attempt moving instance indicated by instanceKey below another instance, based on known master coordinates equivalence.
MoveReplicasGTID will (attempt to) move all replicas of given master below given instance.
MoveUp will attempt moving instance indicated by instanceKey up the topology hierarchy.
MoveUpReplicas will attempt moving up all replicas of a given instance, at the same time.
MultiMatchBelow will efficiently match multiple replicas below a given instance.
No description provided by the author
MultiMatchReplicas will match (via pseudo-gtid) all replicas of given master below given instance.
fetchNextEventsFunc expected to return events starting at a given position, and automatically fetch those from next binary log when no more rows are found in current log.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewInstance creates a new, empty instance.
No description provided by the author
NewInstanceKeyFromStrings creates a new InstanceKey by resolving hostname and port.
No description provided by the author
No description provided by the author
NewOracleGtidSetEntry parses a single entry text.
No description provided by the author
No description provided by the author
ParseInstanceKey will parse an InstanceKey from a string representation such as 127.0.0.1:3306.
ParseInstanceKey will parse an InstanceKey from a string representation such as 127.0.0.1:3306.
ParseCandidatePromotionRule returns a CandidatePromotionRule by name.
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`.
ParseInstanceKey will parse an InstanceKey from a string representation such as 127.0.0.1:3306.
ParseInstanceKeyLoose will parse an InstanceKey from a string representation such as 127.0.0.1:3306.
ParseRawInstanceKeyLoose will parse an InstanceKey from a string representation such as 127.0.0.1:3306.
PopulateInstancesAgents will fill in extra data acquired from agents for given instances At current this is the number of snapshots.
FlushBinaryLogsTo attempts to 'PURGE BINARY LOGS' until given binary log is reached.
FlushBinaryLogsTo attempts to 'PURGE BINARY LOGS' until given binary log is reached.
ReadActiveMaintenance returns the list of currently active maintenance entries.
ReadAliasByClusterName returns the cluster alias for the given cluster name, or the cluster name itself if not explicit alias found.
ReadAllClusterPoolInstances returns all clusters-pools-insatnces associations.
No description provided by the author
ReadAllHostnameUnresolves returns the content of the hostname_unresolve table.
ReadAllHostnameUnresolves returns the content of the hostname_unresolve table.
ReadOutdatedInstanceKeys reads and returns keys for all instances that are not up to date (i.e.
No description provided by the author
No description provided by the author
ReadBinlogServerReplicaInstances reads direct replicas of a given master that are binlog servers.
ReadClusterAliasOverride reads and applies SuggestedClusterAlias based on cluster_alias_override.
ReadClusterCandidateInstances reads cluster instances which are also marked as candidates.
ReadClusterInfo reads some info about a given cluster.
ReadClusterInstances reads all instances of a given cluster.
ReadClusterNameByAlias.
ReadClusterNeutralPromotionRuleInstances reads cluster instances whose promotion-rule is marked as 'neutral'.
ReadClusterPoolInstances reads cluster-pool-instance associationsfor given cluster and pool.
ReadClusterPoolInstancesMap returns association of pools-to-instances for a given cluster and potentially for a given pool.
ReadClusters reads names of all known clusters.
ReadClustersInfo reads names of all known clusters and some aggregated info.
ReadClusterWriteableMaster returns the/a writeable master of this cluster Typically, the cluster name indicates the master of the cluster.
ReadCountMySQLSnapshots is a utility method to return registered number of snapshots for a given list of hosts.
No description provided by the author
ReadDowntimedInstances returns all instances currently downtimed, potentially filtered by cluster.
ReadFuzzyInstance accepts a fuzzy instance key and expects to return a single instance.
ReadFuzzyInstanceKey accepts a fuzzy instance key and expects to return a single, fully qualified, known instance key.
ReadFuzzyInstanceKeyIfPossible accepts a fuzzy instance key and hopes to return a single, fully qualified, known instance key, or else the original given key.
ReadHistoryClusterInstances reads (thin) instances from history.
ReadInstance reads an instance from the orchestrator backend database.
ReadInstanceClusterAttributes will return the cluster name for a given instance by looking at its master and getting it from there.
No description provided by the author
ReadLongRunningProcesses returns the list of current known long running processes of all instances.
ReadLostInRecoveryInstances returns all instances (potentially filtered by cluster) which are currently indicated as downtimed due to being lost during a topology recovery.
ReadMaintenanceInstanceKey will return the instanceKey for active maintenance by maintenanceToken.
ReadOutdatedInstanceKeys reads and returns keys for all instances that are not up to date (i.e.
ReadPeerAnalysisMap reads raft-peer failure analysis, and returns a PeerAnalysisMap, indicating how many peers see which analysis.
ReadProblemInstances reads all instances with problems.
ReadRecentAudit returns a list of audit entries order chronologically descending, using page number.
ReadReplicaInstances reads replicas of a given master.
ReadReplicaInstancesIncludingBinlogServerSubReplicas returns a list of direct slves including any replicas of a binlog server replica.
ReadReplicationAnalysisChangelog.
Attempt to read and return replication credentials from the mysql.slave_master_info system table.
ReadResolvedHostname returns the resolved hostname given a hostname, or empty if not exists.
ReadTopologyInstance collects information on the state of a MySQL server and writes the result synchronously to the orchestrator backend.
ReadTopologyInstanceBufferable connects to a topology MySQL instance and collects information on the server and its replication state.
ReadUnambiguousSuggestedClusterAliases reads hostname:port who have suggested cluster aliases, where no one else shares said suggested cluster alias.
ReadUnseenInstances reads all instances which were not recently seen.
ReadWriteableClustersMasters returns writeable masters of all clusters, but only one per cluster, in similar logic to ReadClusterWriteableMaster.
ReattachReplica restores a detached replica back into replication.
ReattachReplicaMasterHost reattaches a replica back onto its master by undoing a DetachReplicaMasterHost operation.
ReattachReplicaOperation will detach a replica from its master by forcibly corrupting its replication coordinates.
RecordInstanceCoordinatesHistory snapshots the binlog coordinates of instances.
RefreshInstanceSlaveHosts is a workaround for a bug in MySQL where SHOW SLAVE HOSTS continues to present old, long disconnected replicas.
RefreshTopologyInstance will synchronuously re-read topology instance.
RefreshTopologyInstances will do a blocking (though concurrent) refresh of all given instances.
RegexpMatchPatterns returns true if s matches any of the provided regexpPatterns.
RegisterCandidateInstance markes a given instance as suggested for successoring a master in the event of failover.
No description provided by the author
RegroupReplicas is a "smart" method of promoting one replica over the others ("promoting" it on top of its siblings) This method decides which strategy to use: GTID, Pseudo-GTID, Binlog Servers.
RegroupReplicasBinlogServers works on a binlog-servers topology.
RegroupReplicasGTID will choose a candidate replica of a given instance, and take its siblings using GTID.
RegroupReplicasPseudoGTID will choose a candidate replica of a given instance, and take its siblings using pseudo-gtid.
RegroupReplicasPseudoGTIDIncludingSubReplicasOfBinlogServers uses Pseugo-GTID to regroup replicas of given instance.
RelocateBelow will attempt moving instance indicated by instanceKey below another instance.
RelocateReplicas will attempt moving replicas of an instance indicated by instanceKey below another instance.
RematchReplica will re-match a replica to its master, using pseudo-gtid.
removeBinlogServerInstances will remove all binlog servers from given lsit.
removeInstance will remove an instance from a list of instances.
removeNilInstances.
ReplaceAliasClusterName replaces alis mapping of one cluster name onto a new cluster name.
Repoint connects a replica to a master using its exact same executing coordinates.
RepointReplicas repoints all replicas of a given instance onto its existing master.
RepointReplicasTo repoints replicas of a given instance (possibly filtered) onto another master.
RepointTo repoints list of replicas onto another master.
No description provided by the author
ResetInstanceRelaylogCoordinatesHistory forgets about the history of an instance.
ResetMaster issues a RESET MASTER statement on given instance.
ResetMasterGTIDOperation will issue a safe RESET MASTER on a replica that replicates via GTID: It will make sure the gtid_purged set matches the executed set value as read just before the RESET.
ResetSlave resets a replica, breaking the replication.
ResetSlaveOperation will reset a replica.
Attempt to resolve a hostname.
ResolveUnknownMasterHostnameResolves fixes missing hostname resolves based on hostname_resolve_history The use case is replicas replicating from some unknown-hostname which cannot be otherwise found.
RestartSlave stops & starts replication on a given instance.
ReviewUnseenInstances reviews instances that have not been seen (suposedly dead) and updates some of their data.
ScanInstanceRow executes a read-a-single-row query on a given MySQL topology instance.
SearchEntryInBinlog Given a binlog entry text (query), search it in the given binary log of a given instance.
SearchEntryInInstanceBinlogs will search for a specific text entry within the binary logs of a given instance.
No description provided by the author
SearchInstances reads all instances qualifying for some searchString.
SemicolonTerminated is a utility function that makes sure a statement is terminated with a semicolon, if it isn't already.
SetClusterAlias will write (and override) a single cluster name mapping.
SetClusterAliasManualOverride will write (and override) a single cluster name mapping.
No description provided by the author
SetReadOnly sets or clears the instance's global read_only variable.
SkipQuery skip a single query in a failed replication instance.
SkipToNextBinaryLog changes master position to beginning of next binlog USE WITH CARE! Use case is binlog servers where the master was gone & replaced by another.
SnapshotTopologies records topology graph for all existing topologies.
StartSlave starts replication on a given instance.
StartSlaves will do concurrent start-slave.
StartSlaveUntilMasterCoordinates issuesa START SLAVE UNTIL..
StopSlave stops replication on a given instance.
StopSlaveNicely stops a replica such that SQL_thread and IO_thread are aligned (i.e.
StopSlaves will stop replication concurrently on given set of replicas.
StopSlavesNicely will attemt to stop all given replicas nicely, up to timeout.
TakeMaster will move an instance up the chain and cause its master to become its replica.
TakeSiblings is a convenience method for turning sublings of a replica to be its subordinates.
No description provided by the author
UpdateClusterAliases writes down the cluster_alias table based on information gained from database_instance.
UpdateInstanceLastAttemptedCheck updates the last_attempted_check timestamp in the orchestrator backed database for a given instance.
UpdateInstanceLastChecked updates the last_check timestamp in the orchestrator backed database for a given instance.
UpdateResolvedHostname will store the given resolved hostname in cache Returns false when the key already existed with same resolved value (similar to AFFECTED_ROWS() in mysql).
WriteClusterDomainName will write (and override) the domain name of a cluster.
WriteHostnameUnresolve upserts an entry in hostname_unresolve.
WriteLongRunningProcesses rewrites current state of long running processes for given instance.
No description provided by the author
WriteResolvedHostname stores a hostname and the resolved hostname to backend database.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author

# Structs

Audit presents a single audit entry (namely in the database).
BinlogCoordinates described binary log coordinates in the form of log file & log position.
No description provided by the author
.
CandidateDatabaseInstance contains information about explicit promotion rules for an instance.
ClusterInfo makes for a cluster status/info summary.
ClusterPoolInstance is an instance mapping a cluster, pool & instance.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Instance represents a database instance, including its current configuration & status.
No description provided by the author
InstanceBinlogCoordinates is a convenice wrapper for instance key + binlog coordinates.
InstanceKey is an instance indicator, identifued by hostname and port.
No description provided by the author
Maintenance indicates a maintenance entry (also in the database).
OracleGtidSet represents a set of GTID ranges as depicted by Retrieved_Gtid_Set, Executed_Gtid_Set or @@gtid_purged.
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).
No description provided by the author
No description provided by the author
Process presents a MySQL executing thread (as observed by PROCESSLIST).
ReplicationAnalysis notes analysis on replication chain status, per instance.
No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
CandidatePromotionRule describe the promotion preference/rule for an instance.
InstanceKeyMap is a convenience struct for listing InstanceKey-s.
InstancesByCountSlaveHosts is a sortable type for Instance.
No description provided by the author
PeerAnalysisMap indicates the number of peers agreeing on an analysis.
PoolInstancesMap lists instance keys per pool name.
No description provided by the author
No description provided by the author