Documentation ¶
Index ¶
- Constants
- func ChangePrivileges(t *testing.T, sql string, tablet *cluster.Vttablet, user string)
- func CheckPrimaryTablet(t *testing.T, clusterInfo *VtOrcClusterInfo, tablet *cluster.Vttablet, ...)
- func CheckReplication(t *testing.T, clusterInfo *VtOrcClusterInfo, primary *cluster.Vttablet, ...)
- func CheckSourcePort(t *testing.T, replica *cluster.Vttablet, source *cluster.Vttablet, ...)
- func IsPrimarySemiSyncSetupCorrectly(t *testing.T, tablet *cluster.Vttablet, semiSyncVal string) bool
- func IsSemiSyncSetupCorrectly(t *testing.T, tablet *cluster.Vttablet, semiSyncVal string) bool
- func KillTablets(vttablets []*cluster.Vttablet)
- func MakeAPICall(t *testing.T, url string) (status int, response string)
- func MakeAPICallUntilRegistered(t *testing.T, url string) (status int, response string)
- func PermanentlyRemoveVttablet(clusterInfo *VtOrcClusterInfo, tablet *cluster.Vttablet)
- func ResetPrimaryLogs(t *testing.T, curPrimary *cluster.Vttablet)
- func RunSQL(t *testing.T, sql string, tablet *cluster.Vttablet, db string) (*sqltypes.Result, error)
- func SetupVttabletsAndVtorc(t *testing.T, clusterInfo *VtOrcClusterInfo, ...)
- func ShardPrimaryTablet(t *testing.T, clusterInfo *VtOrcClusterInfo, keyspace *cluster.Keyspace, ...) *cluster.Vttablet
- func StartVtorc(t *testing.T, clusterInfo *VtOrcClusterInfo, orcExtraArgs []string, ...)
- func StartVttablet(t *testing.T, clusterInfo *VtOrcClusterInfo, cell string, isRdonly bool) *cluster.Vttablet
- func StopVtorc(t *testing.T, clusterInfo *VtOrcClusterInfo)
- func VerifyWritesSucceed(t *testing.T, clusterInfo *VtOrcClusterInfo, primary *cluster.Vttablet, ...)
- func WaitForReplicationToStop(t *testing.T, vttablet *cluster.Vttablet) error
- type CellInfo
- type VtOrcClusterInfo
Constants ¶
const ( Hostname = "localhost" Cell1 = "zone1" Cell2 = "zone2" )
Variables ¶
This section is empty.
Functions ¶
func ChangePrivileges ¶
ChangePrivileges is used to change the privileges of the given user. These commands are executed such that they are not replicated
func CheckPrimaryTablet ¶
func CheckPrimaryTablet(t *testing.T, clusterInfo *VtOrcClusterInfo, tablet *cluster.Vttablet, checkServing bool)
CheckPrimaryTablet waits until the specified tablet becomes the primary tablet Makes sure the tablet type is primary, and its health check agrees.
func CheckReplication ¶
func CheckReplication(t *testing.T, clusterInfo *VtOrcClusterInfo, primary *cluster.Vttablet, replicas []*cluster.Vttablet, timeToWait time.Duration)
CheckReplication checks that the replication is setup correctly and writes succeed and are replicated on all the replicas
func CheckSourcePort ¶
func CheckSourcePort(t *testing.T, replica *cluster.Vttablet, source *cluster.Vttablet, timeToWait time.Duration)
CheckSourcePort is used to check that the replica has the given source port set in its MySQL instance
func IsPrimarySemiSyncSetupCorrectly ¶
func IsPrimarySemiSyncSetupCorrectly(t *testing.T, tablet *cluster.Vttablet, semiSyncVal string) bool
IsPrimarySemiSyncSetupCorrectly checks that the priamry side semi-sync is setup correctly on the given vttablet
func IsSemiSyncSetupCorrectly ¶
IsSemiSyncSetupCorrectly checks that the semi-sync is setup correctly on the given vttablet
func KillTablets ¶
KillTablets is used to kill the tablets
func MakeAPICall ¶
MakeAPICall is used make an API call given the url. It returns the status and the body of the response received
func MakeAPICallUntilRegistered ¶
MakeAPICallUntilRegistered is used to make an API call and retry if we see a 500 - no successor promoted output. This happens when some other recovery had previously run and the API recovery was unable to be registered due to active timeout period.
func PermanentlyRemoveVttablet ¶
func PermanentlyRemoveVttablet(clusterInfo *VtOrcClusterInfo, tablet *cluster.Vttablet)
PermanentlyRemoveVttablet removes the tablet specified from the cluster. It makes it so that this vttablet or mysql instance are not reused for any other test.
func ResetPrimaryLogs ¶
ResetPrimaryLogs is used reset the binary logs
func RunSQL ¶
func RunSQL(t *testing.T, sql string, tablet *cluster.Vttablet, db string) (*sqltypes.Result, error)
RunSQL is used to run a SQL statement on the given tablet
func SetupVttabletsAndVtorc ¶
func SetupVttabletsAndVtorc(t *testing.T, clusterInfo *VtOrcClusterInfo, numReplicasReqCell1, numRdonlyReqCell1 int, orcExtraArgs []string, configFileName string)
SetupVttabletsAndVtorc is used to setup the vttablets and start the orchestrator
func ShardPrimaryTablet ¶
func ShardPrimaryTablet(t *testing.T, clusterInfo *VtOrcClusterInfo, keyspace *cluster.Keyspace, shard *cluster.Shard) *cluster.Vttablet
ShardPrimaryTablet waits until a primary tablet has been elected for the given shard and returns it
func StartVtorc ¶
func StartVtorc(t *testing.T, clusterInfo *VtOrcClusterInfo, orcExtraArgs []string, configFileName string)
StartVtorc is used to start the orchestrator with the given extra arguments
func StartVttablet ¶
func StartVttablet(t *testing.T, clusterInfo *VtOrcClusterInfo, cell string, isRdonly bool) *cluster.Vttablet
StartVttablet is used to start a vttablet from the given cell and type
func StopVtorc ¶
func StopVtorc(t *testing.T, clusterInfo *VtOrcClusterInfo)
StopVtorc is used to stop the orchestrator
func VerifyWritesSucceed ¶
func VerifyWritesSucceed(t *testing.T, clusterInfo *VtOrcClusterInfo, primary *cluster.Vttablet, replicas []*cluster.Vttablet, timeToWait time.Duration)
VerifyWritesSucceed inserts more data into the table vt_insert_test and checks that it is replicated too Call this function only after CheckReplication has been executed once, since that function creates the table that this function uses.
Types ¶
type CellInfo ¶
type CellInfo struct { CellName string ReplicaTablets []*cluster.Vttablet RdonlyTablets []*cluster.Vttablet // constants that should be set in TestMain NumReplicas int NumRdonly int UIDBase int }
CellInfo stores the information regarding 1 cell including the tablets it contains
type VtOrcClusterInfo ¶
type VtOrcClusterInfo struct { ClusterInstance *cluster.LocalProcessCluster Ts *topo.Server CellInfos []*CellInfo // contains filtered or unexported fields }
VtOrcClusterInfo stores the information for a cluster. This is supposed to be used only for VtOrc tests.
func CreateClusterAndStartTopo ¶
func CreateClusterAndStartTopo(cellInfos []*CellInfo) (*VtOrcClusterInfo, error)
CreateClusterAndStartTopo starts the cluster and topology service
func SetupNewClusterSemiSync ¶
func SetupNewClusterSemiSync(t *testing.T) *VtOrcClusterInfo
SetupNewClusterSemiSync is used to setup a new cluster with semi-sync set. It creates a cluster with 4 tablets, one of which is a Replica