package
1.4.239
Repository: https://github.com/jcesario/orchestrator.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
ASCIITopology returns a string representation of the topology of given instance.
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.
ChangeMasterTo changes the given instance's master according to given input.
DeleteInvalidHostnameResolves removes invalid resolves.
DeregisterHostnameUnresolve removes an unresovle entry.
DetachSlave detaches a slave from replication; forcibly corrupting the binlog coordinates (though in such way that is reversible).
DetachSlaveOperation will detach a slave from its master by forcibly corrupting its replication coordinates.
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.
EnslaveMaster will move an instance up the chain and cause its master to become its slave.
EnslaveSiblings is a convenience method for turning sublings of a slave to be its subordinates.
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.
RegisterCandidateInstance markes a given instance as suggested for successoring a master in the event of failover.
ExpireDowntime will remove the maintenance flag on old downtimes.
ExpireHostnameUnresolve expires hostname_unresolve entries that haven't been updated recently.
ExpireMaintenance will remove the maintenance flag on old maintenances and on bounded maintenances.
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.
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.
GetCandidateSlave chooses the best slave to promote given a (possibly dead) master.
GetClusterByAlias returns the cluster name associated with given alias.
GetClusterHeuristicLag returns a heuristic lag for a cluster, based on its OSC slaves.
GetClusterOSCSlaves returns a heuristic list of slaves which are fit as controll slaves for an OSC operation.
GetCNAME resolves an IP or hostname into a normalized valid CNAME.
GetInstanceMaster synchronously reaches into the replication topology and retrieves master's data.
No description provided by the author
GetNextBinlogCoordinatesToMatch is given a twin-coordinates couple for a would-be slave (instanceKey) and another instance (otherKey).
GetReplicationAnalysis will check for replication problems (dead master; unreachable master; etc).
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.
InstanceIsMasterOf checks whether an instance is the master of another.
InstancesAreSiblings checks whether both instances are replicating from same master.
KillQuery stops replication on a given instance.
No description provided by the author
MakeCoMaster will attempt to make an instance co-master with its master, by making its master a slave of its own.
MakeLocalMaster promotes a slave above its master, making it slave of its grandparent, while also enslaving its siblings.
MakeMaster will take an instance, make all its siblings its slaves (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 slave up the replication chain, so that it becomes sibling of its master, via Pseudo-GTID.
MatchUpSlaves will move all slaves 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.
MoveBelowViaGTID will attempt moving instance indicated by instanceKey below another instance using either Oracle GTID or MaroaDB GTID.
MoveUp will attempt moving instance indicated by instanceKey up the topology hierarchy.
MoveUpSlaves will attempt moving up all slaves of a given instance, at the same time.
MultiMatchBelow will efficiently match multiple slaves below a given instance.
MultiMatchSlaves will match (via pseudo-gtid) all slaves 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.
NewInstance creates a new, empty instance.
NewInstanceKeyFromStrings creates a new InstanceKey by resolving hostname and port.
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.
ParseInstanceKeyLoose 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.
ReadActiveMaintenance returns the list of currently active maintenance entries.
No description provided by the author
ReadClusterAliases reads the entrie cluster name aliases mapping.
ReadClusterAliases reads the entrie cluster name aliases mapping.
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.
ReadClusterNameByMaster 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
ReadClusters reads names of all known clusters.
ReadClustersInfo reads names of all known clusters and some aggregated info.
ReadCountMySQLSnapshots is a utility method to return registered number of snapshots for a given list of hosts.
ReadHistoryClusterInstances reads (thin) instances from history.
ReadInstance reads an instance from the orchestrator backend database.
ReadLongRunningProcesses returns the list of current known long running processes of all instances.
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.
ReadProblemInstances reads all instances with problems.
ReadRecentAudit returns a list of audit entries order chronologically descending, using page number.
ReadResolvedHostname returns the resolved hostname given a hostname, or empty if not exists.
ReadSlaveInstances reads slaves of a given master.
ReadTopologyInstance connects to a topology MySQL instance and reads its configuration and replication status.
ReadUnseenInstances reads all instances which were not recently seen.
ReattachSlave restores a detahced slave back into replication.
ReattachSlaveOperation will detach a slave from its master by forcibly corrupting its replication coordinates.
RefreshInstanceSlaveHosts is a workaround for a bug in MySQL where SHOW SLAVE HOSTS continues to present old, long disconnected slaves.
RefreshTopologyInstance will synchronuously re-read topology instance.
RefreshTopologyInstances will do a blocking (though concurrent) refresh of all given instances.
RegisterCandidateInstance markes a given instance as suggested for successoring a master in the event of failover.
No description provided by the author
RegroupSlaves will choose a candidate slave of a given instance, and enslave its siblings using either simple CHANGE MASTER TO, where possible, or pseudo-gtid.
RematchSlave will re-match a slave to its master, using pseudo-gtid.
Repoint connects a slave to a master using its exact same executing coordinates.
RepointSlaves sequentially repoints all slaves of a given instance onto its existing master.
RepointSlaves sequentially repoints slaves of a given instance (possibly filtered) onto another master.
No description provided by the author
ResetSlave resets a slave, breaking the replication.
ResetSlaveOperation will reset a slave.
Attempt to resolve a hostname.
ResolveUnknownMasterHostnameResolves fixes missing hostname resolves based on hostname_resolve_history The use case is slaves replicating from some unknown-hostname which cannot be otherwise found.
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.
SearchInstances reads all instances qualifying for some searchString.
Given a binlog entry text (query), search it in the given binary log of a given instance.
SearchPseudoGTIDEntryInInstance will search for a specific text entry within the binary logs of a given instance.
SetClusterAlias 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.
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 slave such that SQL_thread and IO_thread are aligned (i.e.
StopSlavesNicely will attemt to stop all given slaves nicely, up to timeout.
No description provided by the author
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).
WriteClusterAlias will write (and override) a single cluster name mapping.
WriteHostnameUnresolve upserts an entry in hostname_unresolve.
WriteLongRunningProcesses rewrites current state of long running processes for given instance.
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

# 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
.
ClusterInfo makes for a cluster status/info summary.
ClusterPoolInstance is an instance mapping a cluster, pool & instance.
No description provided by the author
Instance represents a database instance, including its current configuration & status.
InstanceKey is an instance indicator, identifued by hostname and port.
Maintenance indicates a maintenance entry (also in the database).
Process presents a MySQL executing thread (as observed by PROCESSLIST).
ReplicationAnalysis notes analysis on replication chain status, per instance.

# Type aliases

No description provided by the author
No description provided by the author
InstanceKeyMap is a convenience struct for listing InstanceKey-s.
InstancesByCountSlaveHosts is a sortable type for Instance.
InstancesByExecBinlogCoordinates is a sortabel type for BinlogCoordinates.
PoolInstancesMap lists instance keys per pool name.