Documentation ¶
Index ¶
- Variables
- func SyncRelayLogsToSingleReplica(master *inst.Instance, ...) (synchedFromReplica, synchedToReplica *inst.Instance, err error)
- func SyncReplicaRelayLogs(instance, fromInstance *inst.Instance, ...) (*inst.Instance, error)
- func SyncReplicasRelayLogs(master *inst.Instance, ...) (synchedFromReplica *inst.Instance, ...)
- func TestRemoteCommandOnInstance(instanceKey *inst.InstanceKey) error
- type SyncRelaylogsChangeMasterIdentityFunc
Constants ¶
This section is empty.
Variables ¶
var ApplyRelayLogContentsScript = `` /* 638-byte string literal not displayed */
var GetRelayLogContentsScript = `` /* 3103-byte string literal not displayed */
Functions ¶
func SyncReplicaRelayLogs ¶
func SyncReplicaRelayLogs(instance, fromInstance *inst.Instance, syncRelaylogsChangeMasterIdentityFunc SyncRelaylogsChangeMasterIdentityFunc, startReplication bool) (*inst.Instance, error)
SyncReplicaRelayLogs will align siblings by applying relaylogs from one to the other, via remote SSH
func SyncReplicasRelayLogs ¶
func SyncReplicasRelayLogs( master *inst.Instance, syncRelaylogsChangeMasterIdentityFunc SyncRelaylogsChangeMasterIdentityFunc, avoidPostponingInstance *inst.Instance, startReplication bool, postponedFunctionsContainer *inst.PostponedFunctionsContainer, ) ( synchedFromReplica *inst.Instance, syncedReplicas, failedReplicas, postponedReplicas [](*inst.Instance), err error, )
func TestRemoteCommandOnInstance ¶
func TestRemoteCommandOnInstance(instanceKey *inst.InstanceKey) error
Types ¶
type SyncRelaylogsChangeMasterIdentityFunc ¶
type SyncRelaylogsChangeMasterIdentityFunc func(sourceReplica *inst.Instance, replicas ...*inst.Instance) (masterKey *inst.InstanceKey, coordinates *inst.BinlogCoordinates, err error)
SyncRelaylogsChangeMasterIdentityFunc returns the identity and coorindates into which a replica would CHANGE MASTER TO having been applied with someone else's relaylogs. As examples, in testing we would point such replica back to the master (but with updated coordinates) In real master failover we would point to a candidate replica's self coordinates
nil }return &sourceReplica.MasterKey, &sourceReplica.ExecBinlogCoordinates,
SyncRelaylogsChangeMasterToSharedMasterFunc points applied-to replica to the applied-from replica's master coordinates
var SyncRelaylogsChangeMasterToSourceReplicaFunc SyncRelaylogsChangeMasterIdentityFunc = func(sourceReplica *inst.Instance, replicas ...*inst.Instance) (masterKey *inst.InstanceKey, coordinates *inst.BinlogCoordinates, err error) { if !sourceReplica.LogBinEnabled { return nil, nil, fmt.Errorf("Cannot change master onto source replica %+v since it has no binary logs", sourceReplica.Key) } return &sourceReplica.Key, &sourceReplica.SelfBinlogCoordinates, nil }
SyncRelaylogsChangeMasterToSourceReplicaFunc points applied-to replica to the applied-from replica
var SyncRelaylogsChangeMasterToTargetReplicaFunc SyncRelaylogsChangeMasterIdentityFunc = func(sourceReplica *inst.Instance, replicas ...*inst.Instance) (masterKey *inst.InstanceKey, coordinates *inst.BinlogCoordinates, err error) { if len(replicas) == 0 { return nil, nil, fmt.Errorf("No replicas given to SyncRelaylogsChangeMasterToTargetReplicaFunc") } replica := replicas[0] if !replica.LogBinEnabled { return nil, nil, fmt.Errorf("Cannot change master onto replica %+v since it has no binary logs", replica.Key) } return &replica.Key, &replica.SelfBinlogCoordinates, nil }
SyncRelaylogsChangeMasterToTargetReplicaFunc points replica to the first target replica in given list