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 ReplicationThreadsStatus(t *testing.T, status *replicationdatapb.Status, ...) (bool, bool)
- 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 SetReplicationSourceFailed(tablet *cluster.Vttablet, prsOut string) bool
- func SetupRangeBasedCluster(ctx context.Context, t *testing.T) *cluster.LocalProcessCluster
- func SetupReparentCluster(t *testing.T, enableSemiSync bool) *cluster.LocalProcessCluster
- func SetupReparentClusterLegacy(t *testing.T, enableSemiSync bool) *cluster.LocalProcessCluster
- func StopTablet(t *testing.T, tab *cluster.Vttablet, stopDatabase bool)
- func TeardownCluster(clusterInstance *cluster.LocalProcessCluster)
- func TmcFullStatus(ctx context.Context, tablet *cluster.Vttablet) (*replicationdatapb.FullStatus, error)
- func ValidateTopology(t *testing.T, clusterInstance *cluster.LocalProcessCluster, pingTablets bool)
- func WaitForReplicationPosition(t *testing.T, tabletA *cluster.Vttablet, tabletB *cluster.Vttablet) error
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.
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 ReplicationThreadsStatus ¶ added in v0.14.0
func ReplicationThreadsStatus(t *testing.T, status *replicationdatapb.Status, vtctlVersion, vttabletVersion int) (bool, bool)
ReplicationThreadsStatus returns the status of the IO and SQL thread. It reads the result of the replication status based on the vtctl major version provided. It also uses the vttabletVersion to assert on the expectation of the new fields being unknown for the old vttablets and that they match for the new vttablets
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 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, enableSemiSync bool) *cluster.LocalProcessCluster
SetupReparentCluster is used to setup the reparent cluster
func SetupReparentClusterLegacy ¶ added in v0.14.0
func SetupReparentClusterLegacy(t *testing.T, enableSemiSync bool) *cluster.LocalProcessCluster
SetupReparentClusterLegacy is used to setup the reparent cluster
func StopTablet ¶
StopTablet stops the tablet
func TeardownCluster ¶
func TeardownCluster(clusterInstance *cluster.LocalProcessCluster)
TeardownCluster is used to teardown the reparent cluster
func TmcFullStatus ¶ added in v0.14.0
func TmcFullStatus(ctx context.Context, tablet *cluster.Vttablet) (*replicationdatapb.FullStatus, error)
TmcFullStatus retuns the result of the TabletManagerClient RPC FullStatus
func ValidateTopology ¶
func ValidateTopology(t *testing.T, clusterInstance *cluster.LocalProcessCluster, pingTablets bool)
ValidateTopology is used to validate the topology
Types ¶
This section is empty.