Documentation ¶
Index ¶
- Variables
- func CheckCountOfInsertedValues(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, count int) error
- func CheckDBstatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, variable string, ...)
- func CheckDBvar(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, variable string, ...)
- func CheckInsertedValues(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, index int) error
- func CheckPrimaryTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...)
- func CheckReparentFromOutside(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...)
- func CheckReplicaStatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet)
- func CheckReplicationStatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, ...)
- func CheckSemiSyncSetupCorrectly(t *testing.T, tablet *cluster.Vttablet, semiSyncVal string)
- func ConfirmOldPrimaryIsHangingAround(t *testing.T, clusterInstance *cluster.LocalProcessCluster)
- func ConfirmReplication(t *testing.T, primary *cluster.Vttablet, replicas []*cluster.Vttablet) int
- func DeleteTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...)
- func Ers(clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, ...) (string, error)
- func ErsIgnoreTablet(clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, ...) (string, error)
- func ErsWithVtctl(clusterInstance *cluster.LocalProcessCluster) (string, error)
- func GetNewPrimary(t *testing.T, clusterInstance *cluster.LocalProcessCluster) *cluster.Vttablet
- func GetShardReplicationPositions(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...) []string
- func Prs(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...) (string, error)
- func PrsAvoid(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...) (string, error)
- func PrsWithTimeout(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...) (string, error)
- func RestartTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...)
- func ResurrectTablet(ctx context.Context, t *testing.T, ...)
- func RunSQL(ctx context.Context, t *testing.T, sql string, tablet *cluster.Vttablet) *sqltypes.Result
- func RunSQLs(ctx context.Context, t *testing.T, sqls []string, tablet *cluster.Vttablet) (results []*sqltypes.Result)
- func SetReplicationSourceFailed(tablet *cluster.Vttablet, prsOut string) bool
- func SetupRangeBasedCluster(ctx context.Context, t *testing.T) *cluster.LocalProcessCluster
- func SetupReparentCluster(t *testing.T, durability string) *cluster.LocalProcessCluster
- func StartNewVTTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, uuid int, ...) *cluster.Vttablet
- func StopTablet(t *testing.T, tab *cluster.Vttablet, stopDatabase bool)
- func TeardownCluster(clusterInstance *cluster.LocalProcessCluster)
- func ValidateTopology(t *testing.T, clusterInstance *cluster.LocalProcessCluster, pingTablets bool)
- func WaitForReplicationPosition(t *testing.T, tabletA *cluster.Vttablet, tabletB *cluster.Vttablet) error
- func WaitForReplicationToStart(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...)
- func WaitForTabletToBeServing(t *testing.T, clusterInstance *cluster.LocalProcessCluster, ...)
Constants ¶
This section is empty.
Variables ¶
var ( KeyspaceName = "ks" Hostname = "localhost" ShardName = "0" KeyspaceShard = KeyspaceName + "/" + ShardName )
Functions ¶
func CheckCountOfInsertedValues ¶
func CheckCountOfInsertedValues(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, count int) error
CheckCountOfInsertedValues checks that the number of inserted values matches the given count on the given tablet
func CheckDBstatus ¶
func CheckDBstatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, variable string, status string)
CheckDBstatus checks the db status
func CheckDBvar ¶
func CheckDBvar(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, variable string, status string)
CheckDBvar checks the db var
func CheckInsertedValues ¶
func CheckInsertedValues(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, index int) error
CheckInsertedValues checks that the given value is present in the given tablet
func CheckPrimaryTablet ¶
func CheckPrimaryTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tablet *cluster.Vttablet)
CheckPrimaryTablet makes sure the tablet type is primary, and its health check agrees.
func CheckReparentFromOutside ¶
func CheckReparentFromOutside(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tablet *cluster.Vttablet, downPrimary bool, baseTime int64)
CheckReparentFromOutside checks that cluster was reparented from outside
func CheckReplicaStatus ¶
CheckReplicaStatus checks the replication status and asserts that the replication is stopped
func CheckReplicationStatus ¶
func CheckReplicationStatus(ctx context.Context, t *testing.T, tablet *cluster.Vttablet, sqlThreadRunning bool, ioThreadRunning bool)
CheckReplicationStatus checks that the replication for sql and io threads is setup as expected
func ConfirmOldPrimaryIsHangingAround ¶
func ConfirmOldPrimaryIsHangingAround(t *testing.T, clusterInstance *cluster.LocalProcessCluster)
ConfirmOldPrimaryIsHangingAround confirms that the old primary is hanging around
func ConfirmReplication ¶
ConfirmReplication confirms that the replication is working properly
func DeleteTablet ¶
func DeleteTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet)
DeleteTablet is used to delete the given tablet
func Ers ¶
func Ers(clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, totalTimeout, waitReplicasTimeout string) (string, error)
Ers runs the ERS
func ErsIgnoreTablet ¶
func ErsIgnoreTablet(clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, timeout, waitReplicasTimeout string, tabletsToIgnore []*cluster.Vttablet, preventCrossCellPromotion bool) (string, error)
ErsIgnoreTablet is used to run ERS
func ErsWithVtctl ¶
func ErsWithVtctl(clusterInstance *cluster.LocalProcessCluster) (string, error)
ErsWithVtctl runs ERS via vtctl binary
func GetNewPrimary ¶
GetNewPrimary is used to find the new primary of the cluster.
func GetShardReplicationPositions ¶
func GetShardReplicationPositions(t *testing.T, clusterInstance *cluster.LocalProcessCluster, keyspaceName, shardName string, doPrint bool) []string
GetShardReplicationPositions gets the shards replication positions. This should not generally be called directly, instead use the WaitForReplicationToCatchup method.
func Prs ¶
func Prs(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet) (string, error)
Prs runs PRS
func PrsAvoid ¶
func PrsAvoid(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet) (string, error)
PrsAvoid runs PRS
func PrsWithTimeout ¶
func PrsWithTimeout(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet, avoid bool, actionTimeout, waitTimeout string) (string, error)
PrsWithTimeout runs PRS
func RestartTablet ¶
func RestartTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet)
RestartTablet restarts the tablet
func ResurrectTablet ¶
func ResurrectTablet(ctx context.Context, t *testing.T, clusterInstance *cluster.LocalProcessCluster, tab *cluster.Vttablet)
ResurrectTablet is used to resurrect the given tablet
func RunSQL ¶
func RunSQL(ctx context.Context, t *testing.T, sql string, tablet *cluster.Vttablet) *sqltypes.Result
RunSQL is used to run a SQL command directly on the MySQL instance of a vttablet
func RunSQLs ¶ added in v0.17.6
func RunSQLs(ctx context.Context, t *testing.T, sqls []string, tablet *cluster.Vttablet) (results []*sqltypes.Result)
RunSQLs is used to run SQL commands directly on the MySQL instance of a vttablet
func SetReplicationSourceFailed ¶
SetReplicationSourceFailed returns true if the given output from PRS had failed because the given tablet was unable to setReplicationSource. Since some tests are used in upgrade-downgrade testing, we need this function to work with different versions of vtctl.
func SetupRangeBasedCluster ¶
SetupRangeBasedCluster sets up the range based cluster
func SetupReparentCluster ¶
func SetupReparentCluster(t *testing.T, durability string) *cluster.LocalProcessCluster
SetupReparentCluster is used to setup the reparent cluster
func StartNewVTTablet ¶ added in v0.15.0
func StartNewVTTablet(t *testing.T, clusterInstance *cluster.LocalProcessCluster, uuid int, supportsBackup bool) *cluster.Vttablet
StartNewVTTablet starts a new vttablet instance
func StopTablet ¶
StopTablet stops the tablet
func TeardownCluster ¶
func TeardownCluster(clusterInstance *cluster.LocalProcessCluster)
TeardownCluster is used to teardown the reparent cluster. When run in a CI environment -- which is considered true when the "CI" env variable is set to "true" -- the teardown also removes the VTDATAROOT directory that was used for the test/cluster.
func ValidateTopology ¶
func ValidateTopology(t *testing.T, clusterInstance *cluster.LocalProcessCluster, pingTablets bool)
ValidateTopology is used to validate the topology
func WaitForReplicationPosition ¶
func WaitForReplicationPosition(t *testing.T, tabletA *cluster.Vttablet, tabletB *cluster.Vttablet) error
WaitForReplicationPosition waits for tablet B to catch up to the replication position of tablet A.
func WaitForReplicationToStart ¶ added in v0.15.0
func WaitForTabletToBeServing ¶ added in v0.15.4
Types ¶
This section is empty.