package
1.5.7
Repository: https://github.com/outbrain/orchestrator.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
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.
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.
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).
DetachSlaveMasterHost detaches a slave from its master by corrupting the Master_Host (in such way that is reversible).
DetachSlaveOperation will detach a slave 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.
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.
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.
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.
FindClusterNameByFuzzyInstanceKey attempts to find a uniquely identifyable cluster name given a fuzze 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
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.
GetCandidateSlaveOfBinlogServerTopology chooses the best slave to promote given a (possibly dead) master.
GetClusterByAlias returns the cluster name associated with given alias.
GetClusterGhostSlaves 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 slaves.
No description provided by the author
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.
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
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).
GetSlaveRestartPreserveStatements returns a sequence of statements that make sure a slave is stopped and then returned to the same state.
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.
InstanceIsMasterOf checks whether an instance is the master of another.
InstancesAreSiblings checks whether both instances are replicating from same master.
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 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.
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.
MoveSlavesGTID will (attempt to) move all slaves of given master below given instance.
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.
No description provided by the author
NewOracleGtidSetEntry parses a single entry text.
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.
ReadBinlogServerSlaveInstances reads direct slaves of a given master that are binlog servers.
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.
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.
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.
ReadProblemInstances reads all instances with problems.
ReadRecentAudit returns a list of audit entries order chronologically descending, using page number.
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.
ReadSlaveInstances reads slaves of a given master.
ReadSlaveInstancesIncludingBinlogServerSubSlaves returns a list of direct slves including any slaves of a binlog server replica.
ReadTopologyInstance connects to a topology MySQL instance and reads its configuration and replication status.
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.
ReattachSlave restores a detached slave back into replication.
ReattachSlaveMasterHost reattaches a slave back onto its master by undoing a DetachSlaveMasterHost operation.
ReattachSlaveOperation will detach a slave from its master by forcibly corrupting its replication coordinates.
RecordInstanceBinlogFileHistory snapshots the binlog coordinates of instances.
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 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 is a "smart" method of promoting one slave over the others ("promoting" it on top of its siblings) This method decides which strategy to use: GTID, Pseudo-GTID, Binlog Servers.
RegroupSlavesBinlogServers works on a binlog-servers topology.
RegroupSlavesGTID will choose a candidate slave of a given instance, and enslave its siblings using GTID.
RegroupSlavesPseudoGTID will choose a candidate slave of a given instance, and enslave its siblings using pseudo-gtid.
RegroupSlavesPseudoGTIDIncludingSubSlavesOfBinlogServers uses Pseugo-GTID to regroup slaves of given instance.
RelocateBelow will attempt moving instance indicated by instanceKey below another instance.
RelocateSlaves will attempt moving slaves of an instance indicated by instanceKey below another instance.
RematchSlave will re-match a slave 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 slave to a master using its exact same executing coordinates.
RepointSlaves repoints all slaves of a given instance onto its existing master.
RepointSlavesTo repoints slaves of a given instance (possibly filtered) onto another master.
RepointTo repoints list of slaves onto another master.
No description provided by the author
ResetMaster issues a RESET MASTER statement on given instance.
ResetMasterGTIDOperation will issue a safe RESET MASTER on a slave 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 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.
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.
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.
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 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
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.
UpdateInstanceRecentRelaylogHistory updates the database_instance_recent_relaylog_history table listing the current relaylog coordinates and the one-before.
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.
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

# 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
.
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.
InstanceBinlogCoordinates is a convenice wrapper for instance key + binlog coordinates.
InstanceKey is an instance indicator, identifued by hostname and port.
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
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
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.
InstancesByExecBinlogCoordinates is a sortabel type for BinlogCoordinates.
No description provided by the author
PoolInstancesMap lists instance keys per pool name.
No description provided by the author