remote

package
v3.0.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplyRelayLogContentsScript = `` /* 638-byte string literal not displayed */
View Source
var GetRelayLogContentsScript = `` /* 3103-byte string literal not displayed */

Functions

func SyncRelayLogsToSingleReplica

func SyncRelayLogsToSingleReplica(
	master *inst.Instance,
	syncRelaylogsChangeMasterIdentityFunc SyncRelaylogsChangeMasterIdentityFunc,
	startReplication bool,
) (synchedFromReplica, synchedToReplica *inst.Instance, err error)

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

var SyncRelaylogsChangeMasterToSharedMasterFunc SyncRelaylogsChangeMasterIdentityFunc = func(sourceReplica *inst.Instance, replicas ...*inst.Instance) (masterKey *inst.InstanceKey, coordinates *inst.BinlogCoordinates, err error) {
	return &sourceReplica.MasterKey, &sourceReplica.ExecBinlogCoordinates, nil
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL