onlineddl

package
v0.15.9 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ThrottledAppsTimeout = 60 * time.Second
)

Variables

This section is empty.

Functions

func CheckCancelAllMigrations

func CheckCancelAllMigrations(t *testing.T, vtParams *mysql.ConnParams, expectCount int)

CheckCancelAllMigrations cancels all pending migrations and expect number of affected rows A negative value for expectCount indicates "don't care, no need to check"

func CheckCancelAllMigrationsViaVtctld

func CheckCancelAllMigrationsViaVtctld(t *testing.T, vtctldclient *cluster.VtctldClientProcess, keyspace string)

CheckCancelAllMigrations cancels all pending migrations. There is no validation for affected migrations.

func CheckCancelMigration

func CheckCancelMigration(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectCancelPossible bool)

CheckCancelMigration attempts to cancel a migration, and expects success/failure by counting affected rows

func CheckCleanupMigration

func CheckCleanupMigration(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string)

CheckCleanupMigration attempts to cleanup a migration, and expects success by counting affected rows

func CheckCompleteAllMigrations

func CheckCompleteAllMigrations(t *testing.T, vtParams *mysql.ConnParams, expectCount int)

CheckCompleteAllMigrations completes all pending migrations and expect number of affected rows A negative value for expectCount indicates "don't care, no need to check"

func CheckCompleteMigration

func CheckCompleteMigration(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectCompletePossible bool)

CheckCompleteMigration attempts to complete a migration, and expects success by counting affected rows

func CheckForceMigrationCutOver

func CheckForceMigrationCutOver(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectPossible bool)

CheckForceMigrationCutOver marks a migration for forced cut-over, and expects success by counting affected rows.

func CheckLaunchAllMigrations

func CheckLaunchAllMigrations(t *testing.T, vtParams *mysql.ConnParams, expectCount int)

CheckLaunchAllMigrations launches all queued posponed migrations and expect number of affected rows A negative value for expectCount indicates "don't care, no need to check"

func CheckLaunchMigration

func CheckLaunchMigration(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, launchShards string, expectLaunchPossible bool)

CheckLaunchMigration attempts to launch a migration, and expects success by counting affected rows

func CheckMigrationArtifacts

func CheckMigrationArtifacts(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectArtifacts bool)

CheckMigrationArtifacts verifies given migration exists, and checks if it has artifacts

func CheckMigrationStatus

func CheckMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectStatuses ...schema.OnlineDDLStatus) bool

CheckMigrationStatus verifies that the migration indicated by given UUID has the given expected status

func CheckRetryMigration

func CheckRetryMigration(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectRetryPossible bool)

CheckRetryMigration attempts to retry a migration, and expects success/failure by counting affected rows

func CheckRetryPartialMigration

func CheckRetryPartialMigration(t *testing.T, vtParams *mysql.ConnParams, uuid string, expectAtLeastRowsAffected uint64)

CheckRetryPartialMigration attempts to retry a migration where a subset of shards failed

func CheckThrottledApps

func CheckThrottledApps(t *testing.T, vtParams *mysql.ConnParams, throttlerApp throttlerapp.Name, expectFind bool)

CheckThrottledApps checks for existence or non-existence of an app in the throttled apps list

func CreateTempScript

func CreateTempScript(t *testing.T, content string) (fileName string)

CreateTempScript creates a script in the temporary directory with given content

func GetMySQLVersion

func GetMySQLVersion(t *testing.T, tablet *cluster.Vttablet) string

func MysqlClientExecFile

func MysqlClientExecFile(t *testing.T, mysqlParams *mysql.ConnParams, testDataPath, testName string, fileName string) (output string)

MysqlClientExecFile runs a file through the mysql client

func PrintQueryResult

func PrintQueryResult(writer io.Writer, qr *sqltypes.Result)

PrintQueryResult will pretty-print a QueryResult to the logger.

func ReadMigrationLogs

func ReadMigrationLogs(t *testing.T, vtParams *mysql.ConnParams, uuid string) (logs []string)

ReadMigrationLogs reads migration logs for a given migration, on all shards

func ReadMigrations

func ReadMigrations(t *testing.T, vtParams *mysql.ConnParams, like string) *sqltypes.Result

ReadMigrations reads migration entries

func ThrottleAllMigrations

func ThrottleAllMigrations(t *testing.T, vtParams *mysql.ConnParams)

ThrottleAllMigrations fully throttles online-ddl apps

func UnthrottleAllMigrations

func UnthrottleAllMigrations(t *testing.T, vtParams *mysql.ConnParams)

UnthrottleAllMigrations cancels migration throttling

func ValidateCompletedTimestamp

func ValidateCompletedTimestamp(t *testing.T, vtParams *mysql.ConnParams)

ValidateCompletedTimestamp ensures that any migration in `cancelled`, `completed`, `failed` statuses has a non-nil and valid `completed_timestamp` value.

func ValidateSequentialMigrationIDs

func ValidateSequentialMigrationIDs(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard)

ValidateSequentialMigrationIDs validates that schem_migrations.id column, which is an AUTO_INCREMENT, does not have gaps

func VtgateExecDDL

func VtgateExecDDL(t *testing.T, vtParams *mysql.ConnParams, ddlStrategy string, query string, expectError string) *sqltypes.Result

VtgateExecDDL executes a DDL query with given strategy

func VtgateExecQuery

func VtgateExecQuery(t *testing.T, vtParams *mysql.ConnParams, query string, expectError string) *sqltypes.Result

VtgateExecQuery runs a query on VTGate using given query params

func WaitForMigrationStatus

func WaitForMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, timeout time.Duration, expectStatuses ...schema.OnlineDDLStatus) schema.OnlineDDLStatus

WaitForMigrationStatus waits for a migration to reach either provided statuses (returns immediately), or eventually time out

func WaitForThrottledTimestamp

func WaitForThrottledTimestamp(t *testing.T, vtParams *mysql.ConnParams, uuid string, timeout time.Duration) (
	row sqltypes.RowNamedValues,
	startedTimestamp string,
	lastThrottledTimestamp string,
)

WaitForThrottledTimestamp waits for a migration to have a non-empty last_throttled_timestamp

func WaitForVReplicationStatus

func WaitForVReplicationStatus(t *testing.T, vtParams *mysql.ConnParams, tablet *cluster.Vttablet, uuid string, timeout time.Duration, expectStatuses ...string) (status string)

WaitForVReplicationStatus waits for a vreplication stream to be in one of given states, or timeout

Types

This section is empty.

Jump to

Keyboard shortcuts

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