tabletmanager

package
v0.0.0-...-685946b Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2013 License: BSD-3-Clause Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TABLET_ACTION_PING  = "Ping"
	TABLET_ACTION_SLEEP = "Sleep"

	TABLET_ACTION_SET_RDONLY  = "SetReadOnly"
	TABLET_ACTION_SET_RDWR    = "SetReadWrite"
	TABLET_ACTION_CHANGE_TYPE = "ChangeType"

	TABLET_ACTION_DEMOTE_MASTER = "DemoteMaster"
	TABLET_ACTION_PROMOTE_SLAVE = "PromoteSlave"

	// SlaveWasPromoted tells a tablet this previously slave
	// tablet is now the master. The tablet will update its
	// own topology record.
	TABLET_ACTION_SLAVE_WAS_PROMOTED = "SlaveWasPromoted"

	TABLET_ACTION_RESTART_SLAVE = "RestartSlave"

	// SlaveWasRestarted tells a tablet the mysql master was changed.
	// The tablet will check it is indeed the case, and update its own
	// topology record.
	TABLET_ACTION_SLAVE_WAS_RESTARTED = "SlaveWasRestarted"

	// StopSlave will stop MySQL replication.
	TABLET_ACTION_STOP_SLAVE = "StopSlave"

	TABLET_ACTION_BREAK_SLAVES        = "BreakSlaves"
	TABLET_ACTION_MASTER_POSITION     = "MasterPosition"
	TABLET_ACTION_REPARENT_POSITION   = "ReparentPosition"
	TABLET_ACTION_SLAVE_POSITION      = "SlavePosition"
	TABLET_ACTION_WAIT_SLAVE_POSITION = "WaitSlavePosition"
	TABLET_ACTION_WAIT_BLP_POSITION   = "WaitBlpPosition"
	TABLET_ACTION_SCRAP               = "Scrap"
	TABLET_ACTION_GET_SCHEMA          = "GetSchema"
	TABLET_ACTION_PREFLIGHT_SCHEMA    = "PreflightSchema"
	TABLET_ACTION_APPLY_SCHEMA        = "ApplySchema"
	TABLET_ACTION_GET_PERMISSIONS     = "GetPermissions"
	TABLET_ACTION_EXECUTE_HOOK        = "ExecuteHook"
	TABLET_ACTION_GET_SLAVES          = "GetSlaves"

	TABLET_ACTION_SNAPSHOT            = "Snapshot"
	TABLET_ACTION_SNAPSHOT_SOURCE_END = "SnapshotSourceEnd"
	TABLET_ACTION_RESERVE_FOR_RESTORE = "ReserveForRestore"
	TABLET_ACTION_RESTORE             = "Restore"
	TABLET_ACTION_MULTI_SNAPSHOT      = "MultiSnapshot"
	TABLET_ACTION_MULTI_RESTORE       = "MultiRestore"

	SHARD_ACTION_REPARENT              = "ReparentShard"
	SHARD_ACTION_EXTERNALLY_REPARENTED = "ShardExternallyReparented"
	// Recompute derived shard-wise data
	SHARD_ACTION_REBUILD = "RebuildShard"
	// Generic read lock for inexpensive shard-wide actions.
	SHARD_ACTION_CHECK = "CheckShard"
	// Apply a schema change on an entire shard
	SHARD_ACTION_APPLY_SCHEMA = "ApplySchemaShard"
	// Changes the ServedTypes inside a shard
	SHARD_ACTION_SET_SERVED_TYPES = "SetShardServedTypes"
	// Multi-restore on all tablets of a shard in parallel
	SHARD_ACTION_MULTI_RESTORE = "ShardMultiRestore"
	// Migrate served types from one shard to another
	SHARD_ACTION_MIGRATE_SERVED_TYPES = "MigrateServedTypes"
	// Update the Shard object (Cells, ...)
	SHARD_ACTION_UPDATE_SHARD = "UpdateShard"

	KEYSPACE_ACTION_REBUILD      = "RebuildKeyspace"
	KEYSPACE_ACTION_APPLY_SCHEMA = "ApplySchemaKeyspace"

	ACTION_STATE_QUEUED  = ActionState("")        // All actions are queued initially
	ACTION_STATE_RUNNING = ActionState("Running") // Running inside vtaction process
	ACTION_STATE_FAILED  = ActionState("Failed")  // Ended with a failure
	ACTION_STATE_DONE    = ActionState("Done")    // Ended with no failure
)

Variables

This section is empty.

Functions

func ActionNodeCanBePurged

func ActionNodeCanBePurged(data string) bool

func ActionNodeIsStale

func ActionNodeIsStale(data string) bool

func ActionNodeToJson

func ActionNodeToJson(n *ActionNode) string

func ChangeType

func ChangeType(ts topo.Server, tabletAlias topo.TabletAlias, newType topo.TabletType, runHooks bool) error

Make this external, since these transitions need to be forced from time to time.

func EndPointForTablet

func EndPointForTablet(tablet *topo.Tablet) (*topo.EndPoint, error)

func RegisterTabletManagerConnFactory

func RegisterTabletManagerConnFactory(name string, factory TabletManagerConnFactory)

func Scrap

func Scrap(ts topo.Server, tabletAlias topo.TabletAlias, force bool) error

Make this external, since in needs to be forced from time to time.

func SignalInterrupt

func SignalInterrupt()

In certain cases (vtctl most notably) having SIGINT manifest itself as an instant timeout lets us break out cleanly.

func StoreActionResponse

func StoreActionResponse(ts topo.Server, actionNode *ActionNode, actionPath string, actionErr error) error

Write the result of an action into topology server

func WaitForCompletion

func WaitForCompletion(ts topo.Server, actionPath string, waitTime time.Duration) (interface{}, error)

Types

type ActionAgent

type ActionAgent struct {
	MycnfFile         string // my.cnf file
	DbCredentialsFile string // File that contains db credentials
	// contains filtered or unexported fields
}

func NewActionAgent

func NewActionAgent(topoServer topo.Server, tabletAlias topo.TabletAlias, mycnfFile, dbCredentialsFile string) (*ActionAgent, error)

func (*ActionAgent) AddChangeCallback

func (agent *ActionAgent) AddChangeCallback(f TabletChangeCallback)

func (*ActionAgent) RegisterQueryService

func (agent *ActionAgent) RegisterQueryService(mysqld *mysqlctl.Mysqld)

RegisterQueryService will register all the instances

func (*ActionAgent) Start

func (agent *ActionAgent) Start(mysqlPort, vtPort, vtsPort int) error

bindAddr: the address for the query service advertised by this agent

func (*ActionAgent) Stop

func (agent *ActionAgent) Stop()

func (*ActionAgent) Tablet

func (agent *ActionAgent) Tablet() *topo.TabletInfo

type ActionInitiator

type ActionInitiator struct {
	// contains filtered or unexported fields
}

func NewActionInitiator

func NewActionInitiator(ts topo.Server, tabletManagerProtocol string) *ActionInitiator

func (*ActionInitiator) ApplySchema

func (ai *ActionInitiator) ApplySchema(tabletAlias topo.TabletAlias, sc *mysqlctl.SchemaChange) (actionPath string, err error)

func (*ActionInitiator) ApplySchemaKeyspace

func (ai *ActionInitiator) ApplySchemaKeyspace(change string, simple bool) *ActionNode

func (*ActionInitiator) ApplySchemaShard

func (ai *ActionInitiator) ApplySchemaShard(masterTabletAlias topo.TabletAlias, change string, simple bool) *ActionNode

func (*ActionInitiator) BreakSlaves

func (ai *ActionInitiator) BreakSlaves(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) ChangeType

func (ai *ActionInitiator) ChangeType(tabletAlias topo.TabletAlias, dbType topo.TabletType) (actionPath string, err error)

func (*ActionInitiator) CheckShard

func (ai *ActionInitiator) CheckShard() *ActionNode

func (*ActionInitiator) DemoteMaster

func (ai *ActionInitiator) DemoteMaster(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) ExecuteHook

func (ai *ActionInitiator) ExecuteHook(tabletAlias topo.TabletAlias, _hook *hook.Hook) (actionPath string, err error)

func (*ActionInitiator) GetPermissions

func (ai *ActionInitiator) GetPermissions(tabletAlias topo.TabletAlias, waitTime time.Duration) (*mysqlctl.Permissions, error)

func (*ActionInitiator) GetSchema

func (ai *ActionInitiator) GetSchema(tablet *topo.TabletInfo, tables []string, includeViews bool, waitTime time.Duration) (*mysqlctl.SchemaDefinition, error)

func (*ActionInitiator) GetSlaves

func (ai *ActionInitiator) GetSlaves(tablet *topo.TabletInfo, waitTime time.Duration) (*SlaveList, error)

func (*ActionInitiator) MasterPosition

func (ai *ActionInitiator) MasterPosition(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

func (*ActionInitiator) MigrateServedTypes

func (ai *ActionInitiator) MigrateServedTypes(servedType topo.TabletType) *ActionNode

func (*ActionInitiator) MultiRestore

func (ai *ActionInitiator) MultiRestore(tabletAlias topo.TabletAlias, args *MultiRestoreArgs) (actionPath string, err error)

func (*ActionInitiator) MultiSnapshot

func (ai *ActionInitiator) MultiSnapshot(tabletAlias topo.TabletAlias, args *MultiSnapshotArgs) (actionPath string, err error)

func (*ActionInitiator) Ping

func (ai *ActionInitiator) Ping(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) PreflightSchema

func (ai *ActionInitiator) PreflightSchema(tabletAlias topo.TabletAlias, change string) (actionPath string, err error)

func (*ActionInitiator) PromoteSlave

func (ai *ActionInitiator) PromoteSlave(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) RebuildKeyspace

func (ai *ActionInitiator) RebuildKeyspace() *ActionNode

func (*ActionInitiator) RebuildShard

func (ai *ActionInitiator) RebuildShard() *ActionNode

func (*ActionInitiator) ReparentPosition

func (ai *ActionInitiator) ReparentPosition(tabletAlias topo.TabletAlias, slavePos *mysqlctl.ReplicationPosition) (actionPath string, err error)

func (*ActionInitiator) ReparentShard

func (ai *ActionInitiator) ReparentShard(tabletAlias topo.TabletAlias) *ActionNode

func (*ActionInitiator) ReserveForRestore

func (ai *ActionInitiator) ReserveForRestore(dstTabletAlias topo.TabletAlias, args *ReserveForRestoreArgs) (actionPath string, err error)

func (*ActionInitiator) RestartSlave

func (ai *ActionInitiator) RestartSlave(tabletAlias topo.TabletAlias, args *RestartSlaveData) (actionPath string, err error)

func (*ActionInitiator) Restore

func (ai *ActionInitiator) Restore(dstTabletAlias topo.TabletAlias, args *RestoreArgs) (actionPath string, err error)

func (*ActionInitiator) RpcChangeType

func (ai *ActionInitiator) RpcChangeType(tablet *topo.TabletInfo, dbType topo.TabletType, waitTime time.Duration) error

func (*ActionInitiator) RpcPing

func (ai *ActionInitiator) RpcPing(tabletAlias topo.TabletAlias, waitTime time.Duration) error

func (*ActionInitiator) RpcSlaveWasPromoted

func (ai *ActionInitiator) RpcSlaveWasPromoted(tablet *topo.TabletInfo, waitTime time.Duration) error

func (*ActionInitiator) RpcSlaveWasRestarted

func (ai *ActionInitiator) RpcSlaveWasRestarted(tablet *topo.TabletInfo, args *SlaveWasRestartedData, waitTime time.Duration) error

func (*ActionInitiator) Scrap

func (ai *ActionInitiator) Scrap(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) SetReadOnly

func (ai *ActionInitiator) SetReadOnly(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) SetReadWrite

func (ai *ActionInitiator) SetReadWrite(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) SetShardServedTypes

func (ai *ActionInitiator) SetShardServedTypes(servedTypes []topo.TabletType) *ActionNode

func (*ActionInitiator) ShardExternallyReparented

func (ai *ActionInitiator) ShardExternallyReparented(tabletAlias topo.TabletAlias) *ActionNode

func (*ActionInitiator) ShardMultiRestore

func (ai *ActionInitiator) ShardMultiRestore(args *MultiRestoreArgs) *ActionNode

func (*ActionInitiator) SlavePosition

func (ai *ActionInitiator) SlavePosition(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

func (*ActionInitiator) SlaveWasPromoted

func (ai *ActionInitiator) SlaveWasPromoted(tabletAlias topo.TabletAlias) (actionPath string, err error)

func (*ActionInitiator) SlaveWasRestarted

func (ai *ActionInitiator) SlaveWasRestarted(tabletAlias topo.TabletAlias, args *SlaveWasRestartedData) (actionPath string, err error)

func (*ActionInitiator) Sleep

func (ai *ActionInitiator) Sleep(tabletAlias topo.TabletAlias, duration time.Duration) (actionPath string, err error)

func (*ActionInitiator) Snapshot

func (ai *ActionInitiator) Snapshot(tabletAlias topo.TabletAlias, args *SnapshotArgs) (actionPath string, err error)

func (*ActionInitiator) SnapshotSourceEnd

func (ai *ActionInitiator) SnapshotSourceEnd(tabletAlias topo.TabletAlias, args *SnapshotSourceEndArgs) (actionPath string, err error)

func (*ActionInitiator) StopSlave

func (ai *ActionInitiator) StopSlave(tablet *topo.TabletInfo, waitTime time.Duration) error

func (*ActionInitiator) UpdateShard

func (ai *ActionInitiator) UpdateShard() *ActionNode

func (*ActionInitiator) WaitBlpPosition

func (ai *ActionInitiator) WaitBlpPosition(tabletAlias topo.TabletAlias, blpPosition mysqlctl.BlpPosition, waitTime time.Duration) error

func (*ActionInitiator) WaitForCompletion

func (ai *ActionInitiator) WaitForCompletion(actionPath string, waitTime time.Duration) error

func (*ActionInitiator) WaitForCompletionReply

func (ai *ActionInitiator) WaitForCompletionReply(actionPath string, waitTime time.Duration) (interface{}, error)

func (*ActionInitiator) WaitSlavePosition

func (ai *ActionInitiator) WaitSlavePosition(tablet *topo.TabletInfo, replicationPosition *mysqlctl.ReplicationPosition, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

type ActionNode

type ActionNode struct {
	Action     string
	ActionGuid string
	Error      string
	State      ActionState
	Pid        int // only != 0 if State == ACTION_STATE_RUNNING
	// contains filtered or unexported fields
}

func ActionNodeFromJson

func ActionNodeFromJson(data, path string) (*ActionNode, error)

func (*ActionNode) Path

func (n *ActionNode) Path() string

type ActionState

type ActionState string

type ApplySchemaKeyspaceArgs

type ApplySchemaKeyspaceArgs struct {
	Change string
	Simple bool
}

parameters are stored for debug purposes

type ApplySchemaShardArgs

type ApplySchemaShardArgs struct {
	MasterTabletAlias topo.TabletAlias
	Change            string
	Simple            bool
}

parameters are stored for debug purposes

type GetSchemaArgs

type GetSchemaArgs struct {
	Tables       []string
	IncludeViews bool
}

type GoRpcTabletManagerConn

type GoRpcTabletManagerConn struct {
	// contains filtered or unexported fields
}

func (*GoRpcTabletManagerConn) ChangeType

func (client *GoRpcTabletManagerConn) ChangeType(tablet *topo.TabletInfo, dbType topo.TabletType, waitTime time.Duration) error

func (*GoRpcTabletManagerConn) GetPermissions

func (client *GoRpcTabletManagerConn) GetPermissions(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.Permissions, error)

func (*GoRpcTabletManagerConn) GetSchema

func (client *GoRpcTabletManagerConn) GetSchema(tablet *topo.TabletInfo, tables []string, includeViews bool, waitTime time.Duration) (*mysqlctl.SchemaDefinition, error)

func (*GoRpcTabletManagerConn) GetSlaves

func (client *GoRpcTabletManagerConn) GetSlaves(tablet *topo.TabletInfo, waitTime time.Duration) (*SlaveList, error)

func (*GoRpcTabletManagerConn) MasterPosition

func (client *GoRpcTabletManagerConn) MasterPosition(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

func (*GoRpcTabletManagerConn) Ping

func (client *GoRpcTabletManagerConn) Ping(tablet *topo.TabletInfo, waitTime time.Duration) error

func (*GoRpcTabletManagerConn) SlavePosition

func (client *GoRpcTabletManagerConn) SlavePosition(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

func (*GoRpcTabletManagerConn) SlaveWasPromoted

func (client *GoRpcTabletManagerConn) SlaveWasPromoted(tablet *topo.TabletInfo, waitTime time.Duration) error

func (*GoRpcTabletManagerConn) SlaveWasRestarted

func (client *GoRpcTabletManagerConn) SlaveWasRestarted(tablet *topo.TabletInfo, args *SlaveWasRestartedData, waitTime time.Duration) error

func (*GoRpcTabletManagerConn) StopSlave

func (client *GoRpcTabletManagerConn) StopSlave(tablet *topo.TabletInfo, waitTime time.Duration) error

func (*GoRpcTabletManagerConn) WaitBlpPosition

func (client *GoRpcTabletManagerConn) WaitBlpPosition(tablet *topo.TabletInfo, blpPosition mysqlctl.BlpPosition, waitTime time.Duration) error

func (*GoRpcTabletManagerConn) WaitSlavePosition

func (client *GoRpcTabletManagerConn) WaitSlavePosition(tablet *topo.TabletInfo, replicationPosition *mysqlctl.ReplicationPosition, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

type InitiatorError

type InitiatorError string

func (InitiatorError) Error

func (e InitiatorError) Error() string

type MigrateServedTypesArgs

type MigrateServedTypesArgs struct {
	ServedType topo.TabletType
}

parameters are stored for debug purposes

type MultiRestoreArgs

type MultiRestoreArgs struct {
	SrcTabletAliases       []topo.TabletAlias
	Concurrency            int
	FetchConcurrency       int
	InsertTableConcurrency int
	FetchRetryCount        int
	Strategy               string
}

type MultiSnapshotArgs

type MultiSnapshotArgs struct {
	KeyName          string
	KeyRanges        []key.KeyRange
	Tables           []string
	Concurrency      int
	SkipSlaveRestart bool
	MaximumFilesize  uint64
}

type MultiSnapshotReply

type MultiSnapshotReply struct {
	ParentAlias   topo.TabletAlias
	ManifestPaths []string
}

type ReserveForRestoreArgs

type ReserveForRestoreArgs struct {
	SrcTabletAlias topo.TabletAlias
}

type RestartSlaveData

type RestartSlaveData struct {
	ReplicationState *mysqlctl.ReplicationState
	WaitPosition     *mysqlctl.ReplicationPosition
	TimePromoted     int64 // used to verify replication - a row will be inserted with this timestamp
	Parent           topo.TabletAlias
	Force            bool
}

func (*RestartSlaveData) String

func (rsd *RestartSlaveData) String() string

type RestoreArgs

type RestoreArgs struct {
	SrcTabletAlias        topo.TabletAlias
	SrcFilePath           string
	ParentAlias           topo.TabletAlias
	FetchConcurrency      int
	FetchRetryCount       int
	WasReserved           bool
	DontWaitForSlaveStart bool
}

type SetShardServedTypesArgs

type SetShardServedTypesArgs struct {
	ServedTypes []topo.TabletType
}

parameters are stored for debug purposes

type SlaveList

type SlaveList struct {
	Addrs []string
}

type SlavePositionReq

type SlavePositionReq struct {
	ReplicationPosition mysqlctl.ReplicationPosition
	WaitTimeout         int // seconds, zero to wait indefinitely
}

type SlaveWasRestartedData

type SlaveWasRestartedData struct {
	Parent               topo.TabletAlias
	ExpectedMasterAddr   string
	ExpectedMasterIpAddr string
	ScrapStragglers      bool
}

type SnapshotArgs

type SnapshotArgs struct {
	Concurrency int
	ServerMode  bool
}

type SnapshotReply

type SnapshotReply struct {
	ParentAlias  topo.TabletAlias
	ManifestPath string

	// these two are only used for ServerMode=true full snapshot
	SlaveStartRequired bool
	ReadOnly           bool
}

type SnapshotSourceEndArgs

type SnapshotSourceEndArgs struct {
	SlaveStartRequired bool
	ReadOnly           bool
}

type TabletActor

type TabletActor struct {
	// contains filtered or unexported fields
}

func NewTabletActor

func NewTabletActor(mysqld *mysqlctl.Mysqld, mysqlDaemon mysqlctl.MysqlDaemon, topoServer topo.Server, tabletAlias topo.TabletAlias) *TabletActor

func (*TabletActor) HandleAction

func (ta *TabletActor) HandleAction(actionPath, action, actionGuid string, forceRerun bool) error

This function should be protected from unforseen panics, as dispatchAction will catch everything. The rest of the code in this function should not panic.

type TabletActorError

type TabletActorError string

func (TabletActorError) Error

func (e TabletActorError) Error() string

type TabletChangeCallback

type TabletChangeCallback func(oldTablet, newTablet topo.Tablet)

Each TabletChangeCallback must be idempotent and "threadsafe". The agent will execute these in a new goroutine each time a change is triggered. We won't run two in parallel.

type TabletManager

type TabletManager struct {
	// contains filtered or unexported fields
}

TabletManager is the Go RPC implementation of the RPC service

var TabletManagerRpcService *TabletManager

func (*TabletManager) ChangeType

func (tm *TabletManager) ChangeType(context *rpcproto.Context, args *topo.TabletType, reply *rpc.UnusedResponse) error

func (*TabletManager) GetPermissions

func (tm *TabletManager) GetPermissions(context *rpcproto.Context, args *rpc.UnusedRequest, reply *mysqlctl.Permissions) error

func (*TabletManager) GetSchema

func (tm *TabletManager) GetSchema(context *rpcproto.Context, args *GetSchemaArgs, reply *mysqlctl.SchemaDefinition) error

func (*TabletManager) GetSlaves

func (tm *TabletManager) GetSlaves(context *rpcproto.Context, args *rpc.UnusedRequest, reply *SlaveList) error

func (*TabletManager) MasterPosition

func (tm *TabletManager) MasterPosition(context *rpcproto.Context, args *rpc.UnusedRequest, reply *mysqlctl.ReplicationPosition) error

func (*TabletManager) Ping

func (tm *TabletManager) Ping(context *rpcproto.Context, args, reply *string) error

func (*TabletManager) SlavePosition

func (tm *TabletManager) SlavePosition(context *rpcproto.Context, args *rpc.UnusedRequest, reply *mysqlctl.ReplicationPosition) error

func (*TabletManager) SlaveWasPromoted

func (tm *TabletManager) SlaveWasPromoted(context *rpcproto.Context, args *rpc.UnusedRequest, reply *rpc.UnusedResponse) error

func (*TabletManager) SlaveWasRestarted

func (tm *TabletManager) SlaveWasRestarted(context *rpcproto.Context, args *SlaveWasRestartedData, reply *rpc.UnusedResponse) error

func (*TabletManager) StopSlave

func (tm *TabletManager) StopSlave(context *rpcproto.Context, args *rpc.UnusedRequest, reply *rpc.UnusedResponse) error

func (*TabletManager) WaitBlpPosition

func (tm *TabletManager) WaitBlpPosition(context *rpcproto.Context, args *WaitBlpPositionArgs, reply *rpc.UnusedResponse) error

func (*TabletManager) WaitSlavePosition

func (tm *TabletManager) WaitSlavePosition(context *rpcproto.Context, args *SlavePositionReq, reply *mysqlctl.ReplicationPosition) error

type TabletManagerConn

type TabletManagerConn interface {

	// Ping will try to ping the remote tablet
	Ping(tablet *topo.TabletInfo, waitTime time.Duration) error

	// GetSchema asks the remote tablet for its database schema
	GetSchema(tablet *topo.TabletInfo, tables []string, includeViews bool, waitTime time.Duration) (*mysqlctl.SchemaDefinition, error)

	// GetPermissions asks the remote tablet for its permissions list
	GetPermissions(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.Permissions, error)

	// ChangeType asks the remote tablet to change its type
	ChangeType(tablet *topo.TabletInfo, dbType topo.TabletType, waitTime time.Duration) error

	// SlavePosition returns the tablet's mysql slave position
	SlavePosition(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

	// WaitSlavePosition asks the tablet to wait until it reaches that
	// position in mysql replication
	WaitSlavePosition(tablet *topo.TabletInfo, replicationPosition *mysqlctl.ReplicationPosition, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

	// MasterPosition returns the tablet's master position
	MasterPosition(tablet *topo.TabletInfo, waitTime time.Duration) (*mysqlctl.ReplicationPosition, error)

	// StopSlave stops the mysql replication
	StopSlave(tablet *topo.TabletInfo, waitTime time.Duration) error

	// GetSlaves returns the addresses of the slaves
	GetSlaves(tablet *topo.TabletInfo, waitTime time.Duration) (*SlaveList, error)

	// WaitBlpPosition asks the tablet to wait until it reaches that
	// position in replication
	WaitBlpPosition(tablet *topo.TabletInfo, blpPosition mysqlctl.BlpPosition, waitTime time.Duration) error

	// SlaveWasPromoted tells the remote tablet it is now the master
	SlaveWasPromoted(tablet *topo.TabletInfo, waitTime time.Duration) error

	// SlaveWasRestarted tells the remote tablet its master has changed
	SlaveWasRestarted(tablet *topo.TabletInfo, args *SlaveWasRestartedData, waitTime time.Duration) error
}

TabletManagerConn defines the interface used to talk to a remote tablet

type TabletManagerConnFactory

type TabletManagerConnFactory func(topo.Server) TabletManagerConn

type WaitBlpPositionArgs

type WaitBlpPositionArgs struct {
	BlpPosition mysqlctl.BlpPosition
	WaitTimeout int
}

Jump to

Keyboard shortcuts

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