diff --git a/go/cmd/vtctldclient/command/schema.go b/go/cmd/vtctldclient/command/schema.go index 03e770b3ab7..bd65e3f8e7c 100644 --- a/go/cmd/vtctldclient/command/schema.go +++ b/go/cmd/vtctldclient/command/schema.go @@ -28,11 +28,11 @@ import ( "vitess.io/vitess/go/cmd/vtctldclient/cli" "vitess.io/vitess/go/protoutil" "vitess.io/vitess/go/vt/logutil" - "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/wrangler" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata" "vitess.io/vitess/go/vt/proto/vtrpc" ) @@ -287,7 +287,7 @@ func commandReloadSchemaShard(cmd *cobra.Command, args []string) error { func init() { ApplySchema.Flags().MarkDeprecated("--allow-long-unavailability", "") ApplySchema.Flags().MarkDeprecated("--skip-preflight", "Deprecated. Assumed to be always 'true'") - ApplySchema.Flags().StringVar(&applySchemaOptions.DDLStrategy, "ddl-strategy", string(schema.DDLStrategyDirect), "Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'.") + ApplySchema.Flags().StringVar(&applySchemaOptions.DDLStrategy, "ddl-strategy", strings.ToLower(tabletmanagerdatapb.OnlineDDL_Strategy_name[int32(tabletmanagerdatapb.OnlineDDL_DIRECT)]), "Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'.") ApplySchema.Flags().StringSliceVar(&applySchemaOptions.UUIDList, "uuid", nil, "Optional, comma-delimited, repeatable, explicit UUIDs for migration. If given, must match number of DDL changes.") ApplySchema.Flags().StringVar(&applySchemaOptions.MigrationContext, "migration-context", "", "For Online DDL, optionally supply a custom unique string used as context for the migration(s) in this command. By default a unique context is auto-generated by Vitess.") ApplySchema.Flags().DurationVar(&applySchemaOptions.WaitReplicasTimeout, "wait-replicas-timeout", wrangler.DefaultWaitReplicasTimeout, "Amount of time to wait for replicas to receive the schema change via replication.") diff --git a/go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go b/go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go index 3dc635c8870..ccdd8350ed0 100644 --- a/go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go +++ b/go/test/endtoend/onlineddl/ghost/onlineddl_ghost_test.go @@ -29,6 +29,8 @@ import ( "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/vt/schema" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/onlineddl" "vitess.io/vitess/go/test/endtoend/throttler" @@ -221,11 +223,11 @@ func TestSchemaChange(t *testing.T) { testWithInitialSchema(t) t.Run("create non_online", func(t *testing.T) { - _ = testOnlineDDLStatement(t, alterTableNormalStatement, string(schema.DDLStrategyDirect), "vtctl", "non_online", "") + _ = testOnlineDDLStatement(t, alterTableNormalStatement, "direct", "vtctl", "non_online", "") }) t.Run("successful online alter, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableSuccessfulStatement, "gh-ost", "vtgate", "ghost_col", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) @@ -250,35 +252,35 @@ func TestSchemaChange(t *testing.T) { }) t.Run("successful online alter, vtctl", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "gh-ost", "vtctl", "ghost_col", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("successful online alter, postponed, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "gh-ost -postpone-completion", "vtgate", "ghost_col", "") // Should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, uuid, true) // This part may take a while, because we depend on vreplicatoin polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("throttled migration", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableThrottlingStatement, "gh-ost --max-load=Threads_running=1", "vtgate", "ghost_col", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) t.Run("failed migration", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableFailedStatement, "gh-ost", "vtgate", "ghost_col", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, true) // migration will fail again @@ -304,19 +306,19 @@ func TestSchemaChange(t *testing.T) { }) t.Run("Online DROP, vtctl", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableStatement, "gh-ost", "vtctl", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("Online CREATE, vtctl", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLCreateTableStatement, "gh-ost", "vtctl", "online_ddl_create_col", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("Online DROP TABLE IF EXISTS, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableIfExistsStatement, "gh-ost", "vtgate", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) // this table existed @@ -324,7 +326,7 @@ func TestSchemaChange(t *testing.T) { }) t.Run("Online DROP TABLE IF EXISTS for nonexistent table, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableIfExistsStatement, "gh-ost", "vtgate", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) // this table did not exist @@ -332,19 +334,19 @@ func TestSchemaChange(t *testing.T) { }) t.Run("Online DROP TABLE for nonexistent table, expect error, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableStatement, "gh-ost", "vtgate", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, true) }) t.Run("Online CREATE no PK table, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, noPKCreateTableStatement, "gh-ost", "vtgate", "online_ddl_create_col", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("Fail ALTER for no PK table, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "gh-ost", "vtgate", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) expectedMessage := "No PRIMARY nor UNIQUE key found" rs := onlineddl.ReadMigrations(t, &vtParams, uuid) @@ -405,8 +407,8 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str strategySetting, err := schema.ParseDDLStrategy(ddlStrategy) assert.NoError(t, err) - if !strategySetting.Strategy.IsDirect() { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + if !strategySetting.IsDirect() { + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) } diff --git a/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go b/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go index 3db91ec2868..61dc4ecd9da 100644 --- a/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go +++ b/go/test/endtoend/onlineddl/revert/onlineddl_revert_test.go @@ -33,6 +33,8 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/schema" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/onlineddl" "vitess.io/vitess/go/test/endtoend/throttler" @@ -359,7 +361,7 @@ func testRevertible(t *testing.T) { t.Run("ensure table dropped", func(t *testing.T) { // A preparation step, to clean up anything from the previous test case uuid := testOnlineDDLStatement(t, dropTableStatement, ddlStrategy, "vtgate", tableName, "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) @@ -367,7 +369,7 @@ func testRevertible(t *testing.T) { // A preparation step, to re-create the base table fromStatement := fmt.Sprintf(createTableWrapper, testcase.fromSchema) uuid := testOnlineDDLStatement(t, fromStatement, ddlStrategy, "vtgate", tableName, "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) var uuid string @@ -375,7 +377,7 @@ func testRevertible(t *testing.T) { // This is the migration we will test, and see whether it is revertible or not (and why not). toStatement := fmt.Sprintf(createTableWrapper, testcase.toSchema) uuid = testOnlineDDLStatement(t, toStatement, ddlStrategy, "vtgate", tableName, "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) t.Run("check migration", func(t *testing.T) { @@ -489,7 +491,7 @@ func testRevert(t *testing.T) { t.Run("create base table for view", func(t *testing.T) { uuid := testOnlineDDLStatementForView(t, createViewBaseTableStatement, ddlStrategy, "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewBaseTableName, true) testRevertedUUID(t, uuid, "") }) @@ -500,7 +502,7 @@ func testRevert(t *testing.T) { // The view does not exist uuid := testOnlineDDLStatementForView(t, createViewStatement, ddlStrategy, "vtgate", "success_create") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) testRevertedUUID(t, uuid, "") }) @@ -509,7 +511,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) testRevertedUUID(t, uuid, revertedUUID) }) @@ -518,7 +520,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) testRevertedUUID(t, uuid, revertedUUID) }) @@ -528,7 +530,7 @@ func testRevert(t *testing.T) { // The view exists uuid := testOnlineDDLStatementForView(t, createOrReplaceViewStatement, ddlStrategy, "vtgate", "success_replace") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) testRevertedUUID(t, uuid, "") }) @@ -537,7 +539,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) checkMigratedTable(t, viewName, "success_create") testRevertedUUID(t, uuid, revertedUUID) @@ -547,7 +549,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) checkMigratedTable(t, viewName, "success_replace") testRevertedUUID(t, uuid, revertedUUID) @@ -559,7 +561,7 @@ func testRevert(t *testing.T) { checkTable(t, viewName, true) uuid := testOnlineDDLStatementForView(t, alterViewStatement, ddlStrategy, "vtgate", "success_alter") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) testRevertedUUID(t, uuid, "") }) @@ -568,7 +570,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) checkMigratedTable(t, viewName, "success_replace") testRevertedUUID(t, uuid, revertedUUID) @@ -578,7 +580,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) checkMigratedTable(t, viewName, "success_alter") testRevertedUUID(t, uuid, revertedUUID) @@ -590,13 +592,13 @@ func testRevert(t *testing.T) { // view exists uuid := testOnlineDDLStatementForTable(t, dropViewStatement, "online", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) t.Run("ALTER VIEW where view does not exist", func(t *testing.T) { // The view does not exist. Expect failure uuid := testOnlineDDLStatementForView(t, alterViewStatement, ddlStrategy, "vtgate", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkTable(t, viewName, false) }) @@ -604,21 +606,21 @@ func testRevert(t *testing.T) { // This will recreate the view (well, actually, rename it back into place) uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) }) t.Run("revert revert DROP VIEW", func(t *testing.T) { // This will reapply DROP VIEW uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) t.Run("fail online DROP VIEW", func(t *testing.T) { // The view does now exist uuid := testOnlineDDLStatementForTable(t, dropViewStatement, "online", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkTable(t, viewName, false) }) @@ -627,28 +629,28 @@ func testRevert(t *testing.T) { // The view doesn't actually exist right now uuid := testOnlineDDLStatementForTable(t, dropViewIfExistsStatement, "online", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) t.Run("revert DROP VIEW IF EXISTS", func(t *testing.T) { // View will not be recreated because it didn't exist during the DROP VIEW IF EXISTS uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) t.Run("revert revert DROP VIEW IF EXISTS", func(t *testing.T) { // View still does not exist uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) t.Run("revert revert revert DROP VIEW IF EXISTS", func(t *testing.T) { // View still does not exist uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) @@ -657,7 +659,7 @@ func testRevert(t *testing.T) { // The table does not exist uuid := testOnlineDDLStatementForTable(t, createIfNotExistsStatement, ddlStrategy, "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) testRevertedUUID(t, uuid, "") }) @@ -666,7 +668,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) testRevertedUUID(t, uuid, revertedUUID) }) @@ -675,7 +677,7 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) testRevertedUUID(t, uuid, revertedUUID) }) @@ -684,14 +686,14 @@ func testRevert(t *testing.T) { revertedUUID := uuids[len(uuids)-1] uuid := testRevertMigration(t, revertedUUID, ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) testRevertedUUID(t, uuid, revertedUUID) }) t.Run("online CREATE TABLE", func(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, createStatement, ddlStrategy, "vtgate", "just-created") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) initTable(t) testSelectTableMetrics(t) @@ -701,14 +703,14 @@ func testRevert(t *testing.T) { // This will drop the table (well, actually, rename it away) uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert revert CREATE TABLE", func(t *testing.T) { // Restore the table. Data should still be in the table! uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) testSelectTableMetrics(t) }) @@ -716,13 +718,13 @@ func testRevert(t *testing.T) { // We shouldn't be able to revert one-before-last succcessful migration. uuid := testRevertMigration(t, uuids[len(uuids)-2], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) }) t.Run("CREATE TABLE IF NOT EXISTS where table exists", func(t *testing.T) { // The table exists. A noop. uuid := testOnlineDDLStatementForTable(t, createIfNotExistsStatement, ddlStrategy, "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) t.Run("revert CREATE TABLE IF NOT EXISTS where table existed", func(t *testing.T) { @@ -730,21 +732,21 @@ func testRevert(t *testing.T) { // we expect to _not_ drop it in this revert. A noop. uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) t.Run("revert revert CREATE TABLE IF NOT EXISTS where table existed", func(t *testing.T) { // Table was not dropped, thus isn't re-created, and it just still exists. A noop. uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) t.Run("fail online CREATE TABLE", func(t *testing.T) { // Table already exists uuid := testOnlineDDLStatementForTable(t, createStatement, "online", "vtgate", "just-created") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkTable(t, tableName, true) }) @@ -784,7 +786,7 @@ func testRevert(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, fmt.Sprintf(alterHintStatement, hint), "online", "vtgate", hint) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }() testSelectTableMetrics(t) @@ -813,7 +815,7 @@ func testRevert(t *testing.T) { uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }() checkMigratedTable(t, tableName, alterHints[0]) testSelectTableMetrics(t) @@ -841,7 +843,7 @@ func testRevert(t *testing.T) { uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }() checkMigratedTable(t, tableName, alterHints[1]) testSelectTableMetrics(t) @@ -869,12 +871,12 @@ func testRevert(t *testing.T) { uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }() checkMigratedTable(t, tableName, alterHints[0]) testSelectTableMetrics(t) }) - testPostponedRevert := func(t *testing.T, expectStatuses ...schema.OnlineDDLStatus) { + testPostponedRevert := func(t *testing.T, expectStatuses ...tabletmanagerdatapb.OnlineDDL_Status) { require.NotEmpty(t, expectStatuses) ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -900,12 +902,12 @@ func testRevert(t *testing.T) { // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 60*time.Second, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 60*time.Second, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } t.Run("postponed revert", func(t *testing.T) { - testPostponedRevert(t, schema.OnlineDDLStatusRunning) + testPostponedRevert(t, tabletmanagerdatapb.OnlineDDL_RUNNING) checkMigratedTable(t, tableName, alterHints[1]) testSelectTableMetrics(t) }) @@ -915,7 +917,7 @@ func testRevert(t *testing.T) { // The view does not exist uuid := testOnlineDDLStatementForView(t, createViewStatement, ddlStrategy, "vtgate", "success_create") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) testRevertedUUID(t, uuid, "") }) @@ -926,18 +928,18 @@ func testRevert(t *testing.T) { uuid := testOnlineDDLStatementForView(t, alterViewStatement, ddlStrategy+" --postpone-completion", "vtgate", "success_create") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 60*time.Second, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 60*time.Second, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) testRevertedUUID(t, uuid, "") }) // now verify that the revert for ALTER VIEW respects `--postpone-completion` - testPostponedRevert(t, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + testPostponedRevert(t, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) checkTable(t, viewName, true) }) @@ -945,7 +947,7 @@ func testRevert(t *testing.T) { t.Run("INSTANT DDL: add column", func(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, "alter table stress_test add column i_instant int not null default 0", ddlStrategy+" --prefer-instant-ddl", "vtgate", "i_instant") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) rs := onlineddl.ReadMigrations(t, &vtParams, uuid) @@ -973,9 +975,9 @@ func testRevert(t *testing.T) { assert.NoError(t, err) if instantDDLCapable { // instant DDL expected to apply in 8.0, therefore revert is impossible - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) } else { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } }) @@ -983,14 +985,14 @@ func testRevert(t *testing.T) { t.Run("online DROP TABLE", func(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, dropStatement, "online", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert DROP TABLE", func(t *testing.T) { // This will recreate the table (well, actually, rename it back into place) uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) testSelectTableMetrics(t) }) @@ -998,7 +1000,7 @@ func testRevert(t *testing.T) { // This will reapply DROP TABLE uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) @@ -1007,28 +1009,28 @@ func testRevert(t *testing.T) { // The table doesn't actually exist right now uuid := testOnlineDDLStatementForTable(t, dropIfExistsStatement, "online", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert DROP TABLE IF EXISTS", func(t *testing.T) { // Table will not be recreated because it didn't exist during the DROP TABLE IF EXISTS uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert revert DROP TABLE IF EXISTS", func(t *testing.T) { // Table still does not exist uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert revert revert DROP TABLE IF EXISTS", func(t *testing.T) { // Table still does not exist uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) @@ -1045,7 +1047,7 @@ func testRevert(t *testing.T) { t.Run("partitions: create partitioned table", func(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, createPartitionedTableStatement, ddlStrategy, "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, partitionedTableName, true) populatePartitionedTable(t) @@ -1054,7 +1056,7 @@ func testRevert(t *testing.T) { t.Run("partitions: drop first partition", func(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, "alter table part_test drop partition `p1`", ddlStrategy+" --fast-range-rotation", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, partitionedTableName, true) checkPartitionedTableCountRows(t, 5) @@ -1062,20 +1064,20 @@ func testRevert(t *testing.T) { t.Run("partitions: fail revert drop first partition", func(t *testing.T) { uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkPartitionedTableCountRows(t, 5) }) t.Run("partitions: add new partition", func(t *testing.T) { uuid := testOnlineDDLStatementForTable(t, "alter table part_test add partition (PARTITION p7 VALUES LESS THAN (70))", ddlStrategy+" --fast-range-rotation", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, partitionedTableName, true) }) t.Run("partitions: fail revert add new partition", func(t *testing.T) { uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) }) // FAILURES @@ -1083,14 +1085,14 @@ func testRevert(t *testing.T) { // The table does not exist now uuid := testOnlineDDLStatementForTable(t, dropStatement, "online", "vtgate", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkTable(t, tableName, false) }) t.Run("fail revert failed online DROP TABLE", func(t *testing.T) { // Cannot revert a failed migration uuid := testRevertMigration(t, uuids[len(uuids)-1], ddlStrategy) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkTable(t, tableName, false) }) } @@ -1114,8 +1116,8 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str strategySetting, err := schema.ParseDDLStrategy(ddlStrategy) assert.NoError(t, err) - if !strategySetting.Strategy.IsDirect() { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + if !strategySetting.IsDirect() { + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) } @@ -1146,7 +1148,7 @@ func testRevertMigration(t *testing.T, revertUUID string, ddlStrategy string) (u fmt.Println("# Generated UUID (for debug purposes):") fmt.Printf("<%s>\n", uuid) - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) return uuid } diff --git a/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go b/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go index 694de0747dc..9cd717bce51 100644 --- a/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go +++ b/go/test/endtoend/onlineddl/scheduler/onlineddl_scheduler_test.go @@ -37,6 +37,8 @@ import ( "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/onlineddl" "vitess.io/vitess/go/test/endtoend/throttler" @@ -370,13 +372,13 @@ func testScheduler(t *testing.T) { t.Run("CREATE TABLEs t1, t1", func(t *testing.T) { { // The table does not exist t1uuid = testOnlineDDLStatement(t, createParams(createT1Statement, ddlStrategy, "vtgate", "just-created", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, t1Name, true) } { // The table does not exist t2uuid = testOnlineDDLStatement(t, createParams(createT2Statement, ddlStrategy, "vtgate", "just-created", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, t2Name, true) } testTableSequentialTimes(t, t1uuid, t2uuid) @@ -390,7 +392,7 @@ func testScheduler(t *testing.T) { postponeLaunch := row.AsInt64("postpone_launch", 0) assert.Equal(t, int64(1), postponeLaunch) } - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) t.Run("launch all shards", func(t *testing.T) { onlineddl.CheckLaunchMigration(t, &vtParams, shards, t1uuid, "", true) @@ -400,9 +402,9 @@ func testScheduler(t *testing.T) { postponeLaunch := row.AsInt64("postpone_launch", 0) assert.Equal(t, int64(0), postponeLaunch) } - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) t.Run("Postpone launch ALTER", func(t *testing.T) { @@ -414,7 +416,7 @@ func testScheduler(t *testing.T) { postponeLaunch := row.AsInt64("postpone_launch", 0) assert.Equal(t, int64(1), postponeLaunch) } - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) t.Run("launch irrelevant UUID", func(t *testing.T) { someOtherUUID := "00000000_1111_2222_3333_444444444444" @@ -426,7 +428,7 @@ func testScheduler(t *testing.T) { postponeLaunch := row.AsInt64("postpone_launch", 0) assert.Equal(t, int64(1), postponeLaunch) } - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) }) t.Run("launch irrelevant shards", func(t *testing.T) { onlineddl.CheckLaunchMigration(t, &vtParams, shards, t1uuid, "x,y,z", false) @@ -437,7 +439,7 @@ func testScheduler(t *testing.T) { postponeLaunch := row.AsInt64("postpone_launch", 0) assert.Equal(t, int64(1), postponeLaunch) } - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) }) t.Run("launch relevant shard", func(t *testing.T) { onlineddl.CheckLaunchMigration(t, &vtParams, shards, t1uuid, "x, y, 1", true) @@ -447,9 +449,9 @@ func testScheduler(t *testing.T) { postponeLaunch := row.AsInt64("postpone_launch", 0) assert.Equal(t, int64(0), postponeLaunch) } - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) t.Run("ALTER both tables non-concurrent", func(t *testing.T) { @@ -457,16 +459,16 @@ func testScheduler(t *testing.T) { t2uuid = testOnlineDDLStatement(t, createParams(trivialAlterT2Statement, ddlStrategy, "vtgate", "", "", true)) // skip wait t.Run("wait for t1 complete", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) }) t.Run("wait for t1 complete", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) }) t.Run("check both complete", func(t *testing.T) { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) testTableSequentialTimes(t, t1uuid, t2uuid) }) @@ -476,28 +478,28 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "t1", t1uuid, 0) t.Run("expect t1 running, t2 queued", func(t *testing.T) { - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) // now that t1 is running, let's unblock t2. We expect it to remain queued. onlineddl.CheckCompleteMigration(t, &vtParams, shards, t2uuid, true) time.Sleep(ensureStateNotChangedTime) // t1 should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // non-concurrent -- should be queued! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) }) t.Run("complete t1", func(t *testing.T) { // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("expect t2 to complete", func(t *testing.T) { // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) testTableSequentialTimes(t, t1uuid, t2uuid) }) @@ -510,30 +512,30 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "t1", t1uuid, 1) testAllowConcurrent(t, "t2", t2uuid, 1) t.Run("expect both running", func(t *testing.T) { - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) time.Sleep(ensureStateNotChangedTime) // both should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) t.Run("complete t2", func(t *testing.T) { // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t2uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("complete t1", func(t *testing.T) { // t1 should still be running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) testTableCompletionTimes(t, t2uuid, t1uuid) }) @@ -549,14 +551,14 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "t1", t1uuid, 1) testAllowConcurrent(t, "t2", t2uuid, 1) t.Run("expect t1 running", func(t *testing.T) { - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) // since all migrations are throttled, t1 migration is not ready_to_complete, hence // t2 should not be running - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) time.Sleep(ensureStateNotChangedTime) // both should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) }) t.Run("check ready to complete (before)", func(t *testing.T) { @@ -573,29 +575,29 @@ func testScheduler(t *testing.T) { t.Run("unthrottle, expect t2 running", func(t *testing.T) { onlineddl.UnthrottleAllMigrations(t, &vtParams) // t1 should now be ready_to_complete, hence t2 should start running - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, extendedWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, extendedWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) time.Sleep(ensureStateNotChangedTime) // both should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) t.Run("complete t2", func(t *testing.T) { // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t2uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("complete t1", func(t *testing.T) { // t1 should still be running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("check ready to complete (after)", func(t *testing.T) { for _, uuid := range []string{t1uuid, t2uuid} { @@ -619,8 +621,8 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "t1", t1uuid, 1) t.Run("expect both migrations to run", func(t *testing.T) { - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) }) t.Run("test ready-to-complete", func(t *testing.T) { rs := onlineddl.ReadMigrations(t, &vtParams, t1uuid) @@ -635,19 +637,19 @@ func testScheduler(t *testing.T) { // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t2uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t2uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t2uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("complete t1", func(t *testing.T) { // t1 should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) t.Run("concurrent REVERT vs two non-concurrent DROPs", func(t *testing.T) { @@ -657,35 +659,35 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "t1", t1uuid, 1) testAllowConcurrent(t, "drop3", drop3uuid, 0) t.Run("expect t1 migration to run", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) drop1uuid := testOnlineDDLStatement(t, createParams(dropT1Statement, ddlStrategy, "vtgate", "", "", true)) // skip wait t.Run("drop3 complete", func(t *testing.T) { // drop3 migration should not block. It can run concurrently to t1, and does not conflict - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop3uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop3uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop3uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop3uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("drop1 blocked", func(t *testing.T) { // drop1 migration should block. It can run concurrently to t1, but conflicts on table name - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) // let's cancel it onlineddl.CheckCancelMigration(t, &vtParams, shards, drop1uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop1uuid, normalWaitTime, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) t.Run("complete t1", func(t *testing.T) { // t1 should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) t.Run("non-concurrent REVERT vs three concurrent drops", func(t *testing.T) { @@ -695,75 +697,75 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "drop3", drop3uuid, 1) t.Run("expect t1 migration to run", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) drop1uuid := testOnlineDDLStatement(t, createParams(dropT1Statement, ddlStrategy+" -allow-concurrent", "vtgate", "", "", true)) // skip wait testAllowConcurrent(t, "drop1", drop1uuid, 1) t.Run("t3drop complete", func(t *testing.T) { // drop3 migration should not block. It can run concurrently to t1, and does not conflict - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop3uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop3uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop3uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop3uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("t1drop blocked", func(t *testing.T) { // drop1 migration should block. It can run concurrently to t1, but conflicts on table name - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) }) t.Run("t4 postponed", func(t *testing.T) { // drop4 migration should postpone. - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop4uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop4uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) // Issue a complete and wait for successful completion. drop4 is non-conflicting and should be able to proceed onlineddl.CheckCompleteMigration(t, &vtParams, shards, drop4uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop4uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop4uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop4uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop4uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("complete t1", func(t *testing.T) { // t1 should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("t1drop unblocked", func(t *testing.T) { // t1drop should now be unblocked! - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, t1Name, false) }) t.Run("revert t1 drop", func(t *testing.T) { revertDrop3uuid := testRevertMigration(t, createRevertParams(drop1uuid, ddlStrategy+" -allow-concurrent", "vtgate", "", true)) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertDrop3uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertDrop3uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, revertDrop3uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, revertDrop3uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, t1Name, true) }) }) t.Run("conflicting migration does not block other queued migrations", func(t *testing.T) { t1uuid = testOnlineDDLStatement(t, createParams(trivialAlterT1Statement, ddlStrategy, "vtgate", "", "", false)) // skip wait t.Run("trivial t1 migration", func(t *testing.T) { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, t1Name, true) }) t1uuid = testRevertMigration(t, createRevertParams(t1uuid, ddlStrategy+" -postpone-completion", "vtgate", "", true)) t.Run("expect t1 revert migration to run", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) drop1uuid := testOnlineDDLStatement(t, createParams(dropT1Statement, ddlStrategy+" -allow-concurrent", "vtgate", "", "", true)) // skip wait t.Run("t1drop blocked", func(t *testing.T) { time.Sleep(ensureStateNotChangedTime) // drop1 migration should block. It can run concurrently to t1, but conflicts on table name - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_READY) }) t.Run("t3 ready to complete", func(t *testing.T) { rs := onlineddl.ReadMigrations(t, &vtParams, drop1uuid) @@ -777,26 +779,26 @@ func testScheduler(t *testing.T) { // drop3 migration should not block. It can run concurrently to t1, and does not conflict // even though t1drop is blocked! This is the heart of this test drop3uuid := testOnlineDDLStatement(t, createParams(dropT3Statement, ddlStrategy+" -allow-concurrent", "vtgate", "", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop3uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop3uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("cancel drop1", func(t *testing.T) { // drop1 migration should block. It can run concurrently to t1, but conflicts on table name - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusReady) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_READY) // let's cancel it onlineddl.CheckCancelMigration(t, &vtParams, shards, drop1uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop1uuid, normalWaitTime, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, drop1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, drop1uuid, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) t.Run("complete t1", func(t *testing.T) { // t1 should be still running! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) // This part may take a while, because we depend on vreplication polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) @@ -808,12 +810,12 @@ func testScheduler(t *testing.T) { t.Run("start and fail migration", func(t *testing.T) { executedUUID := testOnlineDDLStatement(t, createParams(trivialAlterT1Statement, ddlStrategy+" -postpone-completion", "vtctl", "", "", true)) // skip wait require.Equal(t, uuid, executedUUID) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) // let's cancel it onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) // now, we submit the exact same migratoin again: same UUID, same migration context. @@ -822,9 +824,9 @@ func testScheduler(t *testing.T) { require.Equal(t, uuid, executedUUID) // expect it to complete - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) rs := onlineddl.ReadMigrations(t, &vtParams, uuid) require.NotNil(t, rs) @@ -844,12 +846,12 @@ func testScheduler(t *testing.T) { t.Run("start and fail migration", func(t *testing.T) { executedUUID := testOnlineDDLStatement(t, createParams(trivialAlterT1Statement, ddlStrategy+" --postpone-completion", "vtctl", "", "", true)) // skip wait require.Equal(t, uuid, executedUUID) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) // let's cancel it onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) // now, we submit the exact same migratoin again: same UUID, same migration context. @@ -858,9 +860,9 @@ func testScheduler(t *testing.T) { require.Equal(t, uuid, executedUUID) // expect it to complete - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) rs := onlineddl.ReadMigrations(t, &vtParams, uuid) require.NotNil(t, rs) @@ -881,15 +883,15 @@ func testScheduler(t *testing.T) { t.Run("expect t1 queued", func(t *testing.T) { // we want to validate that the migration remains queued even after some time passes. It must not move beyond 'queued' time.Sleep(ensureStateNotChangedTime) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) }) t.Run("complete t1", func(t *testing.T) { // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, t1uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) } @@ -898,9 +900,9 @@ func testScheduler(t *testing.T) { t.Run("declarative", func(t *testing.T) { t1uuid = testOnlineDDLStatement(t, createParams(createT1Statement, "mysql --declarative", "vtgate", "just-created", "", false)) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, t1Name, true) }) @@ -909,15 +911,15 @@ func testScheduler(t *testing.T) { // --postpone-completion not supported in mysql strategy time.Sleep(ensureStateNotChangedTime) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusFailed) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusFailed) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_FAILED) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_FAILED) }) t.Run("trivial", func(t *testing.T) { t1uuid := testOnlineDDLStatement(t, createParams(trivialAlterT1Statement, "mysql", "vtgate", "", "", true)) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) rs := onlineddl.ReadMigrations(t, &vtParams, t1uuid) require.NotNil(t, rs) @@ -929,9 +931,9 @@ func testScheduler(t *testing.T) { t.Run("instant", func(t *testing.T) { t1uuid := testOnlineDDLStatement(t, createParams(instantAlterT1Statement, "mysql", "vtgate", "", "", true)) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) // in-order-completion @@ -952,9 +954,9 @@ func testScheduler(t *testing.T) { vuuids = strings.Split(uuidList, "\n") assert.Equal(t, 4, len(vuuids)) for _, uuid := range vuuids { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } }) require.Equal(t, 4, len(vuuids)) @@ -979,9 +981,9 @@ func testScheduler(t *testing.T) { vuuids = strings.Split(uuidList, "\n") assert.Equal(t, 2, len(vuuids)) for _, uuid := range vuuids { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } }) require.Equal(t, 2, len(vuuids)) @@ -995,25 +997,25 @@ func testScheduler(t *testing.T) { testAllowConcurrent(t, "t1", t1uuid, 1) testAllowConcurrent(t, "v1", v1uuid, 1) t.Run("expect table running, expect view ready", func(t *testing.T) { - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, v1uuid, normalWaitTime, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, v1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) time.Sleep(ensureStateNotChangedTime) // nothing should change - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusRunning) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, v1uuid, normalWaitTime, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, v1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY) }) t.Run("complete both", func(t *testing.T) { onlineddl.CheckCompleteAllMigrations(t, &vtParams, len(shards)*2) }) t.Run("expect table success", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, t1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, t1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("expect view success", func(t *testing.T) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, v1uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, v1uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, v1uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, v1uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) testTableCompletionTimes(t, t1uuid, v1uuid) }) @@ -1092,7 +1094,7 @@ DROP TABLE IF EXISTS stress_test // init-cleanup t.Run("init DROP TABLE", func(t *testing.T) { uuid := testOnlineDDLStatement(t, createParams(dropIfExistsStatement, onlineSingletonDDLStrategy, "vtgate", "", "", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) @@ -1101,28 +1103,28 @@ DROP TABLE IF EXISTS stress_test // The table does not exist uuid := testOnlineDDLStatement(t, createParams(createStatement, onlineSingletonDDLStrategy, "vtgate", "", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) t.Run("revert CREATE TABLE", func(t *testing.T) { // The table existed, so it will now be dropped (renamed) uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1], onlineSingletonDDLStrategy, "vtgate", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert revert CREATE TABLE", func(t *testing.T) { // Table was dropped (renamed) so it will now be restored uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1], onlineSingletonDDLStrategy, "vtgate", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) var throttledUUID string t.Run("throttled migration", func(t *testing.T) { throttledUUID = testOnlineDDLStatement(t, createParams(alterTableThrottlingStatement, "gh-ost --singleton --max-load=Threads_running=1", "vtgate", "", "hint_col", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, throttledUUID, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, throttledUUID, tabletmanagerdatapb.OnlineDDL_RUNNING) }) t.Run("failed singleton migration, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, createParams(alterTableThrottlingStatement, "gh-ost --singleton --max-load=Threads_running=1", "vtgate", "", "hint_col", "rejected", true)) @@ -1137,21 +1139,21 @@ DROP TABLE IF EXISTS stress_test assert.Empty(t, uuid) }) t.Run("terminate throttled migration", func(t *testing.T) { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, throttledUUID, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, throttledUUID, tabletmanagerdatapb.OnlineDDL_RUNNING) onlineddl.CheckCancelMigration(t, &vtParams, shards, throttledUUID, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, throttledUUID, 20*time.Second, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, throttledUUID, 20*time.Second, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, throttledUUID, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, throttledUUID, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) t.Run("successful gh-ost alter, vtctl", func(t *testing.T) { uuid := testOnlineDDLStatement(t, createParams(alterTableTrivialStatement, "gh-ost --singleton", "vtctl", "", "hint_col", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("successful gh-ost alter, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, createParams(alterTableTrivialStatement, "gh-ost --singleton", "vtgate", "", "hint_col", "", false)) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) @@ -1159,7 +1161,7 @@ DROP TABLE IF EXISTS stress_test t.Run("successful online alter, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, createParams(alterTableTrivialStatement, onlineSingletonDDLStrategy, "vtgate", "", "hint_col", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) checkTable(t, tableName, true) @@ -1168,7 +1170,7 @@ DROP TABLE IF EXISTS stress_test // The table existed, so it will now be dropped (renamed) uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1], onlineSingletonDDLStrategy, "vtctl", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) @@ -1179,7 +1181,7 @@ DROP TABLE IF EXISTS stress_test throttledUUIDs = strings.Split(uuidList, "\n") assert.Equal(t, 3, len(throttledUUIDs)) for _, uuid := range throttledUUIDs { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY, tabletmanagerdatapb.OnlineDDL_RUNNING) } }) t.Run("failed migrations, singleton-context", func(t *testing.T) { @@ -1187,13 +1189,13 @@ DROP TABLE IF EXISTS stress_test }) t.Run("terminate throttled migrations", func(t *testing.T) { for _, uuid := range throttledUUIDs { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY, tabletmanagerdatapb.OnlineDDL_RUNNING) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, true) } time.Sleep(2 * time.Second) for _, uuid := range throttledUUIDs { uuid = strings.TrimSpace(uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) } }) @@ -1203,7 +1205,7 @@ DROP TABLE IF EXISTS stress_test assert.Equal(t, 3, len(uuidSlice)) for _, uuid := range uuidSlice { uuid = strings.TrimSpace(uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } }) @@ -1212,14 +1214,14 @@ DROP TABLE IF EXISTS stress_test t.Run("online DROP TABLE", func(t *testing.T) { uuid := testOnlineDDLStatement(t, createParams(dropStatement, onlineSingletonDDLStrategy, "vtgate", "", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("revert DROP TABLE", func(t *testing.T) { // This will recreate the table (well, actually, rename it back into place) uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1], onlineSingletonDDLStrategy, "vttablet", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) }) @@ -1228,31 +1230,31 @@ DROP TABLE IF EXISTS stress_test uuids = append(uuids, uuid) _ = testOnlineDDLStatement(t, createParams(dropNonexistentTableStatement, "vitess --singleton", "vtgate", "", "hint_col", "rejected", true)) onlineddl.CheckCompleteAllMigrations(t, &vtParams, len(shards)) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, 20*time.Second, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("fail concurrent singleton-context with revert", func(t *testing.T) { revertUUID := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1], "vitess --allow-concurrent --postpone-completion --singleton-context", "vtctl", "rev:ctx", "", false)) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, tabletmanagerdatapb.OnlineDDL_RUNNING) // revert is running _ = testOnlineDDLStatement(t, createParams(dropNonexistentTableStatement, "vitess --allow-concurrent --singleton-context", "vtctl", "migrate:ctx", "", "rejected", true)) onlineddl.CheckCancelMigration(t, &vtParams, shards, revertUUID, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, revertUUID, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, revertUUID, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) t.Run("success concurrent singleton-context with no-context revert", func(t *testing.T) { revertUUID := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1], "vitess --allow-concurrent --postpone-completion", "vtctl", "rev:ctx", "", false)) - onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, schema.OnlineDDLStatusRunning) + onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, tabletmanagerdatapb.OnlineDDL_RUNNING) // revert is running but has no --singleton-context. Our next migration should be able to run. uuid := testOnlineDDLStatement(t, createParams(dropNonexistentTableStatement, "vitess --allow-concurrent --singleton-context", "vtctl", "migrate:ctx", "", "", false)) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, revertUUID, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, revertUUID, 20*time.Second, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, revertUUID, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, revertUUID, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) } func testDeclarative(t *testing.T) { @@ -1517,7 +1519,7 @@ func testDeclarative(t *testing.T) { return &testRevertMigrationParams{ revertUUID: revertUUID, executeStrategy: "vtctl", - ddlStrategy: string(schema.DDLStrategyOnline), + ddlStrategy: schema.OnlineDDLStrategyName(tabletmanagerdatapb.OnlineDDL_ONLINE), } } @@ -1525,19 +1527,19 @@ func testDeclarative(t *testing.T) { t.Run("init: drop table", func(t *testing.T) { // IF EXISTS is not supported in -declarative uuid := testOnlineDDL(t, dropIfExistsStatement, "online", "vtgate", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("init: drop view base table", func(t *testing.T) { // IF EXISTS is not supported in -declarative uuid := testOnlineDDL(t, dropViewBaseTableStatement, "online", "vtgate", "", "") - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) // VIEWS t.Run("create base table for view", func(t *testing.T) { uuid := testOnlineDDL(t, createViewBaseTableStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewBaseTableName, true) }) // CREATE VIEW 1 @@ -1545,7 +1547,7 @@ func testDeclarative(t *testing.T) { // The table does not exist uuid := testOnlineDDL(t, createViewStatement1, declarativeStrategy, "vtgate", "success_create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, viewName, true) }) @@ -1554,7 +1556,7 @@ func testDeclarative(t *testing.T) { // The exists with exact same schema uuid := testOnlineDDL(t, createViewStatement1, declarativeStrategy, "vtgate", "success_create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, false) checkTable(t, viewName, true) }) @@ -1562,7 +1564,7 @@ func testDeclarative(t *testing.T) { // Reverting a noop changes nothing uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, viewName, "success_create1") checkTable(t, viewName, true) }) @@ -1571,7 +1573,7 @@ func testDeclarative(t *testing.T) { // IF NOT EXISTS is not supported in -declarative uuid := testOnlineDDL(t, createOrReplaceViewStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkMigratedTable(t, viewName, "success_create1") checkTable(t, viewName, true) }) @@ -1579,7 +1581,7 @@ func testDeclarative(t *testing.T) { // IF NOT EXISTS is not supported in -declarative uuid := testOnlineDDL(t, alterViewStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkMigratedTable(t, viewName, "success_create1") checkTable(t, viewName, true) }) @@ -1587,14 +1589,14 @@ func testDeclarative(t *testing.T) { // IF NOT EXISTS is not supported in -declarative uuid := testOnlineDDL(t, dropViewIfExistsStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkMigratedTable(t, viewName, "success_create1") checkTable(t, viewName, true) }) t.Run("declarative DROP VIEW", func(t *testing.T) { uuid := testOnlineDDL(t, dropViewStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, viewName, false) }) @@ -1605,7 +1607,7 @@ func testDeclarative(t *testing.T) { // The table does not exist uuid := testOnlineDDL(t, createViewStatement1, declarativeStrategy, "vtgate", "success_create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, viewName, true) }) @@ -1614,7 +1616,7 @@ func testDeclarative(t *testing.T) { // The table exists with different schema uuid := testOnlineDDL(t, createViewStatement2, declarativeStrategy, "vtgate", "success_create2", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, viewName, true) }) @@ -1622,7 +1624,7 @@ func testDeclarative(t *testing.T) { // Reverting back to 1st version uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, viewName, "success_create1") checkTable(t, viewName, true) }) @@ -1630,7 +1632,7 @@ func testDeclarative(t *testing.T) { // Table exists uuid := testOnlineDDL(t, dropViewStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, viewName, false) }) @@ -1638,7 +1640,7 @@ func testDeclarative(t *testing.T) { // This will recreate the table (well, actually, rename it back into place) uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, true) checkMigratedTable(t, viewName, "success_create1") }) @@ -1646,13 +1648,13 @@ func testDeclarative(t *testing.T) { // This will reapply DROP VIEW uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) t.Run("declarative DROP VIEW where view does not exist", func(t *testing.T) { uuid := testOnlineDDL(t, dropViewStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, false) checkTable(t, viewName, false) }) @@ -1660,7 +1662,7 @@ func testDeclarative(t *testing.T) { // Table will not be recreated because it didn't exist during the previous DROP VIEW uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, viewName, false) }) // View dropped. Let's start afresh. @@ -1672,7 +1674,7 @@ func testDeclarative(t *testing.T) { // The table does not exist uuid := testOnlineDDL(t, createStatement1, declarativeStrategy, "vtgate", "create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, true) initTable(t) @@ -1683,7 +1685,7 @@ func testDeclarative(t *testing.T) { // The exists with exact same schema uuid := testOnlineDDL(t, createStatement1, declarativeStrategy, "vtgate", "create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, false) checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1692,7 +1694,7 @@ func testDeclarative(t *testing.T) { // Reverting a noop changes nothing uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, tableName, "create1") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1700,7 +1702,7 @@ func testDeclarative(t *testing.T) { t.Run("declarative DROP TABLE", func(t *testing.T) { uuid := testOnlineDDL(t, dropStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, false) }) @@ -1711,7 +1713,7 @@ func testDeclarative(t *testing.T) { // The table does not exist uuid := testOnlineDDL(t, createStatement1, declarativeStrategy, "vtgate", "create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, true) initTable(t) @@ -1722,7 +1724,7 @@ func testDeclarative(t *testing.T) { // The table exists with different schema uuid := testOnlineDDL(t, createStatement2, declarativeStrategy, "vtgate", "create2", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1731,7 +1733,7 @@ func testDeclarative(t *testing.T) { // Reverting back to 1st version uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, tableName, "create1") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1740,7 +1742,7 @@ func testDeclarative(t *testing.T) { // Table exists uuid := testOnlineDDL(t, dropStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, false) }) @@ -1748,7 +1750,7 @@ func testDeclarative(t *testing.T) { // This will recreate the table (well, actually, rename it back into place) uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, true) checkMigratedTable(t, tableName, "create1") testSelectTableMetrics(t) @@ -1757,13 +1759,13 @@ func testDeclarative(t *testing.T) { // This will reapply DROP TABLE uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) t.Run("declarative DROP TABLE where table does not exist", func(t *testing.T) { uuid := testOnlineDDL(t, dropStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, false) checkTable(t, tableName, false) }) @@ -1771,7 +1773,7 @@ func testDeclarative(t *testing.T) { // Table will not be recreated because it didn't exist during the previous DROP TABLE uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkTable(t, tableName, false) }) // Table dropped. Let's start afresh. @@ -1781,7 +1783,7 @@ func testDeclarative(t *testing.T) { // The table does not exist uuid := testOnlineDDL(t, createStatement1, declarativeStrategy, "vtgate", "create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, true) initTable(t) @@ -1792,7 +1794,7 @@ func testDeclarative(t *testing.T) { // The table exists but with different schema uuid := testOnlineDDL(t, createStatement2, declarativeStrategy, "vtgate", "create2", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1802,7 +1804,7 @@ func testDeclarative(t *testing.T) { // The table exists but with different schema uuid := testOnlineDDL(t, createStatement1, declarativeStrategy, "vtgate", "create1", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckMigrationArtifacts(t, &vtParams, shards, uuid, true) checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1811,7 +1813,7 @@ func testDeclarative(t *testing.T) { // Reverting back to previous version uuid := testRevertMigration(t, createRevertParams(uuids[len(uuids)-1])) uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, tableName, "create2") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1820,7 +1822,7 @@ func testDeclarative(t *testing.T) { // ALTER is not supported in -declarative uuid := testOnlineDDL(t, alterStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkMigratedTable(t, tableName, "create2") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1829,7 +1831,7 @@ func testDeclarative(t *testing.T) { // IF NOT EXISTS is not supported in -declarative uuid := testOnlineDDL(t, createIfNotExistsStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkMigratedTable(t, tableName, "create2") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1838,7 +1840,7 @@ func testDeclarative(t *testing.T) { // IF EXISTS is not supported in -declarative uuid := testOnlineDDL(t, dropIfExistsStatement, declarativeStrategy, "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) checkMigratedTable(t, tableName, "create2") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1849,7 +1851,7 @@ func testDeclarative(t *testing.T) { // unrelated error. uuid := testOnlineDDL(t, createIfNotExistsStatement, "online", "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) // the table existed, so we expect no changes in this non-declarative DDL checkMigratedTable(t, tableName, "create2") checkTable(t, tableName, true) @@ -1858,7 +1860,7 @@ func testDeclarative(t *testing.T) { t.Run("CREATE TABLE with zero date and --allow-zero-in-date is successful", func(t *testing.T) { uuid := testOnlineDDL(t, createStatementZeroDate, "online --allow-zero-in-date", "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, "zerodate_test", "create_with_zero") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1866,7 +1868,7 @@ func testDeclarative(t *testing.T) { t.Run("CREATE TABLE with zero date and --allow-zero-in-date is successful", func(t *testing.T) { uuid := testOnlineDDL(t, createStatementZeroDate, "online -declarative --allow-zero-in-date", "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, "zerodate_test", "create_with_zero") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1874,7 +1876,7 @@ func testDeclarative(t *testing.T) { t.Run("CREATE TABLE with zero date and --allow-zero-in-date is successful", func(t *testing.T) { uuid := testOnlineDDL(t, createStatementZeroDate2, "online -declarative --allow-zero-in-date", "vtgate", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) checkMigratedTable(t, "zerodate_test", "create_with_zero2") checkTable(t, tableName, true) testSelectTableMetrics(t) @@ -1886,7 +1888,7 @@ func testDeclarative(t *testing.T) { t.Run("Trivial statement with request context is successful", func(t *testing.T) { uuid := testOnlineDDL(t, trivialAlterStatement, "online", "vtctl", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) // the table existed, so we expect no changes in this non-declarative DDL checkTable(t, tableName, true) @@ -1900,7 +1902,7 @@ func testDeclarative(t *testing.T) { t.Run("Duplicate trivial statement with request context is successful", func(t *testing.T) { uuid := testOnlineDDL(t, trivialAlterStatement, "online", "vtctl", "", "") uuids = append(uuids, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) // the table existed, so we expect no changes in this non-declarative DDL checkTable(t, tableName, true) @@ -2062,7 +2064,7 @@ func testForeignKeys(t *testing.T) { for _, statement := range createStatements { t.Run(statement, func(t *testing.T) { uuid := testStatement(t, statement, ddlStrategyAllowFK, "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) } }) @@ -2077,11 +2079,11 @@ func testForeignKeys(t *testing.T) { t.Run("run migration", func(t *testing.T) { if testcase.allowForeignKeys { uuid = testStatement(t, testcase.sql, ddlStrategyAllowFK, testcase.expectHint, false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } else { uuid = testStatement(t, testcase.sql, ddlStrategy, "", true) if uuid != "" { - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) } } }) @@ -2163,8 +2165,8 @@ func testOnlineDDLStatement(t *testing.T, params *testOnlineDDLStatementParams) fmt.Println("# Generated UUID (for debug purposes):") fmt.Printf("<%s>\n", uuid) - if !strategySetting.Strategy.IsDirect() && !params.skipWait && uuid != "" { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + if !strategySetting.IsDirect() && !params.skipWait && uuid != "" { + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalWaitTime, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) } diff --git a/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go b/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go index ab2775dc89d..eb72d33b7e3 100644 --- a/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go +++ b/go/test/endtoend/onlineddl/vrepl/onlineddl_vrepl_test.go @@ -39,6 +39,7 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) var ( @@ -271,14 +272,14 @@ func TestSchemaChange(t *testing.T) { testWithInitialSchema(t) t.Run("alter non_online", func(t *testing.T) { - _ = testOnlineDDLStatement(t, alterTableNormalStatement, string(schema.DDLStrategyDirect), providedUUID, providedMigrationContext, "vtctl", "non_online", "", false) + _ = testOnlineDDLStatement(t, alterTableNormalStatement, "direct", providedUUID, providedMigrationContext, "vtctl", "non_online", "", false) insertRows(t, 2) testRows(t) }) t.Run("successful online alter, vtgate", func(t *testing.T) { insertRows(t, 2) uuid := testOnlineDDLStatement(t, alterTableSuccessfulStatement, "online", providedUUID, providedMigrationContext, "vtgate", "vrepl_col", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) testRows(t) testMigrationRowCount(t, uuid) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) @@ -307,7 +308,7 @@ func TestSchemaChange(t *testing.T) { t.Run("successful online alter, vtctl", func(t *testing.T) { insertRows(t, 2) uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "online", providedUUID, providedMigrationContext, "vtctl", "vrepl_col", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) testRows(t) testMigrationRowCount(t, uuid) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) @@ -320,7 +321,7 @@ func TestSchemaChange(t *testing.T) { providedMigrationContext = "endtoend:0000-1111" uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess", providedUUID, providedMigrationContext, "vtctl", "vrepl_col", "", false) assert.Equal(t, providedUUID, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) testRows(t) testMigrationRowCount(t, uuid) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) @@ -330,7 +331,7 @@ func TestSchemaChange(t *testing.T) { t.Run("duplicate migration, implicitly ignored", func(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "online", providedUUID, providedMigrationContext, "vtctl", "vrepl_col", "", true) assert.Equal(t, providedUUID, uuid) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("fail duplicate migration with different context", func(t *testing.T) { _ = testOnlineDDLStatement(t, alterTableTrivialStatement, "online", providedUUID, "endtoend:different-context-0000", "vtctl", "vrepl_col", "rejected", true) @@ -342,14 +343,14 @@ func TestSchemaChange(t *testing.T) { insertRows(t, 2) uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess -postpone-completion", providedUUID, providedMigrationContext, "vtgate", "test_val", "", false) // Should be still running! - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, uuid, true) // This part may take a while, because we depend on vreplicatoin polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) testRows(t) testMigrationRowCount(t, uuid) @@ -367,12 +368,12 @@ func TestSchemaChange(t *testing.T) { defer onlineddl.UnthrottleAllMigrations(t, &vtParams) uuid := testOnlineDDLStatement(t, alterTableThrottlingStatement, "online", providedUUID, providedMigrationContext, "vtgate", "vrepl_col", "", true) - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusRunning) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_RUNNING) testRows(t) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, true) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusCancelled) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_CANCELLED) }) t.Run("throttled and unthrottled migration", func(t *testing.T) { @@ -385,8 +386,8 @@ func TestSchemaChange(t *testing.T) { onlineddl.CheckThrottledApps(t, &vtParams, throttlerapp.OnlineDDLName, true) uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess", providedUUID, providedMigrationContext, "vtgate", "test_val", "", true) - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) testRows(t) // gotta give the migration a few seconds to read throttling info from _vt.vreplication and write @@ -403,9 +404,9 @@ func TestSchemaChange(t *testing.T) { onlineddl.UnthrottleAllMigrations(t, &vtParams) onlineddl.CheckThrottledApps(t, &vtParams, throttlerapp.OnlineDDLName, false) - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("throttled and unthrottled migration via vstreamer", func(t *testing.T) { @@ -418,8 +419,8 @@ func TestSchemaChange(t *testing.T) { require.NoError(t, err) uuid = testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess", providedUUID, providedMigrationContext, "vtgate", "test_val", "", true) - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) testRows(t) // gotta give the migration a few seconds to read throttling info from _vt.vreplication and write @@ -440,15 +441,15 @@ func TestSchemaChange(t *testing.T) { assert.Contains(t, []string{throttlerapp.VStreamerName.String(), throttlerapp.RowStreamerName.String()}, component) }() // now unthrottled - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("failed migration", func(t *testing.T) { insertRows(t, 2) uuid := testOnlineDDLStatement(t, alterTableFailedStatement, "online", providedUUID, providedMigrationContext, "vtgate", "vrepl_col", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) testRows(t) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, true) @@ -519,8 +520,8 @@ func TestSchemaChange(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess", providedUUID, providedMigrationContext, "vtgate", "test_val", "", true) t.Run("wait for migration to run", func(t *testing.T) { - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) t.Run("wait for vreplication to run on shard -80", func(t *testing.T) { vreplStatus := onlineddl.WaitForVReplicationStatus(t, &vtParams, currentPrimaryTablet, uuid, normalMigrationWait, binlogdatapb.VReplicationWorkflowState_Copying.String(), binlogdatapb.VReplicationWorkflowState_Running.String()) @@ -532,7 +533,7 @@ func TestSchemaChange(t *testing.T) { }) t.Run("check status again", func(t *testing.T) { // again see that we're still 'running' - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) testRows(t) }) @@ -567,8 +568,8 @@ func TestSchemaChange(t *testing.T) { assert.NoError(t, err) }) t.Run("expect completion", func(t *testing.T) { - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("Check tablet post PRS", func(t *testing.T) { @@ -595,7 +596,7 @@ func TestSchemaChange(t *testing.T) { onlineddl.CheckRetryPartialMigration(t, &vtParams, uuid, 1) // Now it should complete on the failed shard - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusComplete) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) } @@ -614,8 +615,8 @@ func TestSchemaChange(t *testing.T) { uuid := testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess --postpone-completion", providedUUID, providedMigrationContext, "vtgate", "test_val", "", true) t.Run("wait for migration to run", func(t *testing.T) { - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusRunning) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_RUNNING) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) }) t.Run("wait for vreplication to run on shard -80", func(t *testing.T) { vreplStatus := onlineddl.WaitForVReplicationStatus(t, &vtParams, currentPrimaryTablet, uuid, normalMigrationWait, binlogdatapb.VReplicationWorkflowState_Copying.String(), binlogdatapb.VReplicationWorkflowState_Running.String()) @@ -627,7 +628,7 @@ func TestSchemaChange(t *testing.T) { }) t.Run("check status again", func(t *testing.T) { // again see that we're still 'running' - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusRunning) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_RUNNING) testRows(t) }) @@ -665,8 +666,8 @@ func TestSchemaChange(t *testing.T) { onlineddl.CheckCompleteAllMigrations(t, &vtParams, len(shards)) - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) t.Run("Check tablet post PRS", func(t *testing.T) { @@ -693,7 +694,7 @@ func TestSchemaChange(t *testing.T) { onlineddl.CheckRetryPartialMigration(t, &vtParams, uuid, 1) // Now it should complete on the failed shard - _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusComplete) + _ = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE) }) }) } @@ -708,19 +709,19 @@ func TestSchemaChange(t *testing.T) { assert.Equal(t, int64(1), readyToComplete) } }) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("Online CREATE, vtctl", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLCreateTableStatement, "vitess", providedUUID, providedMigrationContext, "vtctl", "online_ddl_create_col", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("Online DROP TABLE IF EXISTS, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableIfExistsStatement, "online ", providedUUID, providedMigrationContext, "vtgate", "", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) // this table existed @@ -729,14 +730,14 @@ func TestSchemaChange(t *testing.T) { t.Run("Online CREATE, vtctl, extra flags", func(t *testing.T) { // the flags are meaningless to this migration. The test just validates that they don't get in the way. uuid := testOnlineDDLStatement(t, onlineDDLCreateTableStatement, "vitess --prefer-instant-ddl --allow-zero-in-date", providedUUID, providedMigrationContext, "vtctl", "online_ddl_create_col", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) t.Run("Online DROP TABLE IF EXISTS, vtgate, extra flags", func(t *testing.T) { // the flags are meaningless to this migration. The test just validates that they don't get in the way. uuid := testOnlineDDLStatement(t, onlineDDLDropTableIfExistsStatement, "vitess --prefer-instant-ddl --allow-zero-in-date", providedUUID, providedMigrationContext, "vtgate", "", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) // this table existed @@ -744,7 +745,7 @@ func TestSchemaChange(t *testing.T) { }) t.Run("Online DROP TABLE IF EXISTS for nonexistent table, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableIfExistsStatement, "online", providedUUID, providedMigrationContext, "vtgate", "", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) // this table did not exist @@ -753,13 +754,13 @@ func TestSchemaChange(t *testing.T) { t.Run("Online DROP TABLE IF EXISTS for nonexistent table, postponed", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableIfExistsStatement, "vitess -postpone-completion", providedUUID, providedMigrationContext, "vtgate", "", "", false) // Should be still queued, never promoted to 'ready'! - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) // Issue a complete and wait for successful completion onlineddl.CheckCompleteMigration(t, &vtParams, shards, uuid, true) // This part may take a while, because we depend on vreplicatoin polling - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, extendedMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) // this table did not exist @@ -767,13 +768,13 @@ func TestSchemaChange(t *testing.T) { }) t.Run("Online DROP TABLE for nonexistent table, expect error, vtgate", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLDropTableStatement, "online", providedUUID, providedMigrationContext, "vtgate", "", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_FAILED) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, true) }) t.Run("Online CREATE, vtctl", func(t *testing.T) { uuid := testOnlineDDLStatement(t, onlineDDLCreateTableStatement, "vitess", providedUUID, providedMigrationContext, "vtctl", "online_ddl_create_col", "", false) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) onlineddl.CheckCancelMigration(t, &vtParams, shards, uuid, false) onlineddl.CheckRetryMigration(t, &vtParams, shards, uuid, false) }) @@ -789,14 +790,14 @@ func TestSchemaChange(t *testing.T) { uuid = testOnlineDDLStatement(t, alterTableTrivialStatement, "vitess --postpone-launch", providedUUID, providedMigrationContext, "vtgate", "test_val", "", true) onlineddl.CheckLaunchMigration(t, &vtParams, shards[0:1], uuid, "-80", true) { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[:1], uuid, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[:1], uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards[:1], uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards[:1], uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) } { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[1:], uuid, normalMigrationWait, schema.OnlineDDLStatusQueued) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[1:], uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_QUEUED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards[1:], uuid, schema.OnlineDDLStatusQueued) + onlineddl.CheckMigrationStatus(t, &vtParams, shards[1:], uuid, tabletmanagerdatapb.OnlineDDL_QUEUED) } }) t.Run("check cancel migration", func(t *testing.T) { @@ -818,15 +819,15 @@ func TestSchemaChange(t *testing.T) { t.Run("migrations were cancelled, revert should impossible", func(t *testing.T) { { // shard 0 migration was complete. Revert should be successful - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[:1], revertUUID, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[:1], revertUUID, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards[:1], revertUUID, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards[:1], revertUUID, tabletmanagerdatapb.OnlineDDL_FAILED) } { // shard 0 migration was cancelled. Revert should not be possible - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[1:], revertUUID, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards[1:], revertUUID, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) - onlineddl.CheckMigrationStatus(t, &vtParams, shards[1:], revertUUID, schema.OnlineDDLStatusFailed) + onlineddl.CheckMigrationStatus(t, &vtParams, shards[1:], revertUUID, tabletmanagerdatapb.OnlineDDL_FAILED) } }) t.Run("expect two rows in SHOW VITESS_MIGRATIONS", func(t *testing.T) { @@ -840,9 +841,9 @@ func TestSchemaChange(t *testing.T) { switch shard { case "-80": - require.Equal(t, string(schema.OnlineDDLStatusComplete), status) + require.Equal(t, schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_COMPLETE), status) case "80-": - require.Equal(t, string(schema.OnlineDDLStatusFailed), status) + require.Equal(t, schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_FAILED), status) default: require.NoError(t, fmt.Errorf("unexpected shard name: %s", shard)) } @@ -939,11 +940,11 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str strategySetting, err := schema.ParseDDLStrategy(ddlStrategy) assert.NoError(t, err) - if strategySetting.Strategy.IsDirect() { + if strategySetting.IsDirect() { skipWait = true } if !skipWait { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, normalMigrationWait, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) } diff --git a/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go b/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go index 1f1f3b9c5b7..7a3adc28d87 100644 --- a/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go +++ b/go/test/endtoend/onlineddl/vrepl_stress/onlineddl_vrepl_mini_stress_test.go @@ -33,6 +33,8 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/schema" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/onlineddl" "vitess.io/vitess/go/test/endtoend/throttler" @@ -272,7 +274,7 @@ func TestSchemaChange(t *testing.T) { initTable(t) hint := "hint-alter-without-workload" uuid := testOnlineDDLStatement(t, fmt.Sprintf(alterHintStatement, hint), onlineDDLStrategy, "vtgate", hint) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) testSelectTableMetrics(t) }) @@ -301,7 +303,7 @@ func TestSchemaChange(t *testing.T) { }() hint := fmt.Sprintf("hint-alter-with-workload-%d", i) uuid := testOnlineDDLStatement(t, fmt.Sprintf(alterHintStatement, hint), onlineDDLStrategy, "vtgate", hint) - onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, schema.OnlineDDLStatusComplete) + onlineddl.CheckMigrationStatus(t, &vtParams, shards, uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE) cancel() // will cause runMultipleConnections() to terminate wg.Wait() }) @@ -348,8 +350,8 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str strategySetting, err := schema.ParseDDLStrategy(ddlStrategy) assert.NoError(t, err) - if !strategySetting.Strategy.IsDirect() { - status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, migrationWaitTimeout, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + if !strategySetting.IsDirect() { + status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, migrationWaitTimeout, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) } diff --git a/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go b/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go index 92fb7cf13e5..8a1b4c2f93b 100644 --- a/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go +++ b/go/test/endtoend/onlineddl/vrepl_stress_suite/onlineddl_vrepl_stress_suite_test.go @@ -45,6 +45,8 @@ import ( "vitess.io/vitess/go/vt/log" "vitess.io/vitess/go/vt/schema" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/onlineddl" "vitess.io/vitess/go/test/endtoend/throttler" @@ -523,9 +525,9 @@ func TestSchemaChange(t *testing.T) { runMultipleConnections(ctx, t, testcase.autoIncInsert) }() uuid := testOnlineDDLStatement(t, fullStatement, onlineDDLStrategy, "vtgate", hintText) - expectStatus := schema.OnlineDDLStatusComplete + expectStatus := tabletmanagerdatapb.OnlineDDL_COMPLETE if testcase.expectFailure { - expectStatus = schema.OnlineDDLStatusFailed + expectStatus = tabletmanagerdatapb.OnlineDDL_FAILED } status := onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, waitForStatusTimeout, expectStatus) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) @@ -578,13 +580,13 @@ func testOnlineDDLStatement(t *testing.T, alterStatement string, ddlStrategy str strategySetting, err := schema.ParseDDLStrategy(ddlStrategy) assert.NoError(t, err) - status := schema.OnlineDDLStatusComplete - if !strategySetting.Strategy.IsDirect() { - status = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, waitForStatusTimeout, schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed) + status := tabletmanagerdatapb.OnlineDDL_COMPLETE + if !strategySetting.IsDirect() { + status = onlineddl.WaitForMigrationStatus(t, &vtParams, shards, uuid, waitForStatusTimeout, tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED) fmt.Printf("# Migration status (for debug purposes): <%s>\n", status) } - if expectHint != "" && status == schema.OnlineDDLStatusComplete { + if expectHint != "" && status == tabletmanagerdatapb.OnlineDDL_COMPLETE { checkMigratedTable(t, afterTableName, expectHint) } return uuid diff --git a/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go b/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go index c8b87215036..d326c7bc2f7 100644 --- a/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go +++ b/go/test/endtoend/onlineddl/vrepl_suite/onlineddl_vrepl_suite_test.go @@ -32,6 +32,8 @@ import ( "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "vitess.io/vitess/go/test/endtoend/onlineddl" "vitess.io/vitess/go/test/endtoend/throttler" @@ -250,13 +252,13 @@ func testSingle(t *testing.T, testName string) { if expectedErrorMessage, exists := readTestFile(t, testName, "expect_failure"); exists { // Failure is expected! - assert.Contains(t, []string{string(schema.OnlineDDLStatusFailed), string(schema.OnlineDDLStatusCancelled)}, migrationStatus) + assert.Contains(t, []string{schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_FAILED), schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_CANCELLED)}, migrationStatus) require.Contains(t, migrationMessage, expectedErrorMessage, "expected error message (%s) to contain (%s)", migrationMessage, expectedErrorMessage) // no need to proceed to checksum or anything further return } // We do not expect failure. - require.Equal(t, string(schema.OnlineDDLStatusComplete), migrationStatus, migrationMessage) + require.Equal(t, schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_COMPLETE), migrationStatus, migrationMessage) if content, exists := readTestFile(t, testName, "expect_table_structure"); exists { createStatement := getCreateTableStatement(t, afterTableName) @@ -319,7 +321,7 @@ func waitForMigration(t *testing.T, uuid string, timeout time.Duration) sqltypes row := readMigration(t, uuid) status = row["migration_status"].ToString() switch status { - case string(schema.OnlineDDLStatusComplete), string(schema.OnlineDDLStatusFailed), string(schema.OnlineDDLStatusCancelled): + case schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_COMPLETE), schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_FAILED), schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_CANCELLED): // migration is complete, either successful or not return row } diff --git a/go/test/endtoend/onlineddl/vtgate_util.go b/go/test/endtoend/onlineddl/vtgate_util.go index c3b1bfa8864..3a6f1035d7c 100644 --- a/go/test/endtoend/onlineddl/vtgate_util.go +++ b/go/test/endtoend/onlineddl/vtgate_util.go @@ -33,6 +33,8 @@ import ( "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + "vitess.io/vitess/go/test/endtoend/cluster" "github.com/stretchr/testify/assert" @@ -202,7 +204,7 @@ func CheckLaunchAllMigrations(t *testing.T, vtParams *mysql.ConnParams, expectCo } // CheckMigrationStatus verifies that the migration indicated by given UUID has the given expected status -func CheckMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectStatuses ...schema.OnlineDDLStatus) { +func CheckMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, expectStatuses ...tabletmanagerdatapb.OnlineDDL_Status) { query, err := sqlparser.ParseAndBind("show vitess_migrations like %a", sqltypes.StringBindVariable(uuid), ) @@ -218,7 +220,7 @@ func CheckMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []clu continue } for _, expectStatus := range expectStatuses { - if row["migration_status"].ToString() == string(expectStatus) { + if row["migration_status"].ToString() == schema.OnlineDDLStatusName(expectStatus) { count++ break } @@ -228,7 +230,7 @@ func CheckMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []clu } // WaitForMigrationStatus waits for a migration to reach either provided statuses (returns immediately), or eventually time out -func WaitForMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, timeout time.Duration, expectStatuses ...schema.OnlineDDLStatus) schema.OnlineDDLStatus { +func WaitForMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []cluster.Shard, uuid string, timeout time.Duration, expectStatuses ...tabletmanagerdatapb.OnlineDDL_Status) tabletmanagerdatapb.OnlineDDL_Status { shardNames := map[string]bool{} for _, shard := range shards { shardNames[shard.Name] = true @@ -238,12 +240,12 @@ func WaitForMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []c ) require.NoError(t, err) - statusesMap := map[string]bool{} + statusesMap := map[tabletmanagerdatapb.OnlineDDL_Status]bool{} for _, status := range expectStatuses { - statusesMap[string(status)] = true + statusesMap[status] = true } startTime := time.Now() - lastKnownStatus := "" + var lastKnownStatus tabletmanagerdatapb.OnlineDDL_Status for time.Since(startTime) < timeout { countMatchedShards := 0 r := VtgateExecQuery(t, vtParams, query, "") @@ -253,17 +255,25 @@ func WaitForMigrationStatus(t *testing.T, vtParams *mysql.ConnParams, shards []c // irrelevant shard continue } - lastKnownStatus = row["migration_status"].ToString() + s, err := schema.ParseOnlineDDLStatus(row["migration_status"].ToString()) + switch err { + case nil: + lastKnownStatus = s + default: + t.Logf("failed to parse last known status %s: %s", row["migration_status"].ToString(), err) + continue + } + if row["migration_uuid"].ToString() == uuid && statusesMap[lastKnownStatus] { countMatchedShards++ } } if countMatchedShards == len(shards) { - return schema.OnlineDDLStatus(lastKnownStatus) + return lastKnownStatus } time.Sleep(1 * time.Second) } - return schema.OnlineDDLStatus(lastKnownStatus) + return lastKnownStatus } // CheckMigrationArtifacts verifies given migration exists, and checks if it has artifacts diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go index 167d848b034..a6b6ec664cc 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata.pb.go @@ -96,6 +96,279 @@ func (TabletSelectionPreference) EnumDescriptor() ([]byte, []int) { return file_tabletmanagerdata_proto_rawDescGZIP(), []int{0} } +type OnlineDDL_Strategy int32 + +const ( + // OnlineDDL_VITESS uses vreplication to run the OnlineDDL migration. It is + // the default strategy for OnlineDDL requests.option + // + // OnlineDDL_VITESS was also formerly called "ONLINE". + OnlineDDL_VITESS OnlineDDL_Strategy = 0 + OnlineDDL_ONLINE OnlineDDL_Strategy = 0 + OnlineDDL_GHOST OnlineDDL_Strategy = 1 + OnlineDDL_PTOSC OnlineDDL_Strategy = 2 + // OnlineDDL_DIRECT runs the migration directly against MySQL (e.g. `ALTER TABLE ...`), + // meaning it is not actually an "online" DDL migration. + OnlineDDL_DIRECT OnlineDDL_Strategy = 3 + // OnlineDDL_MYSQL is a managed migration (queued and executed by the + // scheduler) but runs through a MySQL `ALTER TABLE`. + OnlineDDL_MYSQL OnlineDDL_Strategy = 4 +) + +// Enum value maps for OnlineDDL_Strategy. +var ( + OnlineDDL_Strategy_name = map[int32]string{ + 0: "VITESS", + // Duplicate value: 0: "ONLINE", + 1: "GHOST", + 2: "PTOSC", + 3: "DIRECT", + 4: "MYSQL", + } + OnlineDDL_Strategy_value = map[string]int32{ + "VITESS": 0, + "ONLINE": 0, + "GHOST": 1, + "PTOSC": 2, + "DIRECT": 3, + "MYSQL": 4, + } +) + +func (x OnlineDDL_Strategy) Enum() *OnlineDDL_Strategy { + p := new(OnlineDDL_Strategy) + *p = x + return p +} + +func (x OnlineDDL_Strategy) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OnlineDDL_Strategy) Descriptor() protoreflect.EnumDescriptor { + return file_tabletmanagerdata_proto_enumTypes[1].Descriptor() +} + +func (OnlineDDL_Strategy) Type() protoreflect.EnumType { + return &file_tabletmanagerdata_proto_enumTypes[1] +} + +func (x OnlineDDL_Strategy) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OnlineDDL_Strategy.Descriptor instead. +func (OnlineDDL_Strategy) EnumDescriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{0, 0} +} + +type OnlineDDL_Status int32 + +const ( + OnlineDDL_UNKNOWN OnlineDDL_Status = 0 + OnlineDDL_REQUESTED OnlineDDL_Status = 1 + OnlineDDL_CANCELLED OnlineDDL_Status = 2 + OnlineDDL_QUEUED OnlineDDL_Status = 3 + OnlineDDL_READY OnlineDDL_Status = 4 + OnlineDDL_RUNNING OnlineDDL_Status = 5 + OnlineDDL_COMPLETE OnlineDDL_Status = 6 + OnlineDDL_FAILED OnlineDDL_Status = 7 +) + +// Enum value maps for OnlineDDL_Status. +var ( + OnlineDDL_Status_name = map[int32]string{ + 0: "UNKNOWN", + 1: "REQUESTED", + 2: "CANCELLED", + 3: "QUEUED", + 4: "READY", + 5: "RUNNING", + 6: "COMPLETE", + 7: "FAILED", + } + OnlineDDL_Status_value = map[string]int32{ + "UNKNOWN": 0, + "REQUESTED": 1, + "CANCELLED": 2, + "QUEUED": 3, + "READY": 4, + "RUNNING": 5, + "COMPLETE": 6, + "FAILED": 7, + } +) + +func (x OnlineDDL_Status) Enum() *OnlineDDL_Status { + p := new(OnlineDDL_Status) + *p = x + return p +} + +func (x OnlineDDL_Status) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OnlineDDL_Status) Descriptor() protoreflect.EnumDescriptor { + return file_tabletmanagerdata_proto_enumTypes[2].Descriptor() +} + +func (OnlineDDL_Status) Type() protoreflect.EnumType { + return &file_tabletmanagerdata_proto_enumTypes[2] +} + +func (x OnlineDDL_Status) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OnlineDDL_Status.Descriptor instead. +func (OnlineDDL_Status) EnumDescriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{0, 1} +} + +type OnlineDDL struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Keyspace string `protobuf:"bytes,1,opt,name=keyspace,proto3" json:"keyspace,omitempty"` + Table string `protobuf:"bytes,2,opt,name=table,proto3" json:"table,omitempty"` + Schema string `protobuf:"bytes,3,opt,name=schema,proto3" json:"schema,omitempty"` + Sql string `protobuf:"bytes,4,opt,name=sql,proto3" json:"sql,omitempty"` + Uuid string `protobuf:"bytes,5,opt,name=uuid,proto3" json:"uuid,omitempty"` + Strategy OnlineDDL_Strategy `protobuf:"varint,6,opt,name=strategy,proto3,enum=tabletmanagerdata.OnlineDDL_Strategy" json:"strategy,omitempty"` + Options string `protobuf:"bytes,7,opt,name=options,proto3" json:"options,omitempty"` + MigrationContext string `protobuf:"bytes,8,opt,name=migration_context,json=migrationContext,proto3" json:"migration_context,omitempty"` + Status OnlineDDL_Status `protobuf:"varint,9,opt,name=status,proto3,enum=tabletmanagerdata.OnlineDDL_Status" json:"status,omitempty"` + TabletAlias *topodata.TabletAlias `protobuf:"bytes,10,opt,name=tablet_alias,json=tabletAlias,proto3" json:"tablet_alias,omitempty"` + Retries int64 `protobuf:"varint,11,opt,name=retries,proto3" json:"retries,omitempty"` + ReadyToComplete bool `protobuf:"varint,12,opt,name=ready_to_complete,json=readyToComplete,proto3" json:"ready_to_complete,omitempty"` + WasReadyToComplete bool `protobuf:"varint,13,opt,name=was_ready_to_complete,json=wasReadyToComplete,proto3" json:"was_ready_to_complete,omitempty"` +} + +func (x *OnlineDDL) Reset() { + *x = OnlineDDL{} + if protoimpl.UnsafeEnabled { + mi := &file_tabletmanagerdata_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *OnlineDDL) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OnlineDDL) ProtoMessage() {} + +func (x *OnlineDDL) ProtoReflect() protoreflect.Message { + mi := &file_tabletmanagerdata_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use OnlineDDL.ProtoReflect.Descriptor instead. +func (*OnlineDDL) Descriptor() ([]byte, []int) { + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{0} +} + +func (x *OnlineDDL) GetKeyspace() string { + if x != nil { + return x.Keyspace + } + return "" +} + +func (x *OnlineDDL) GetTable() string { + if x != nil { + return x.Table + } + return "" +} + +func (x *OnlineDDL) GetSchema() string { + if x != nil { + return x.Schema + } + return "" +} + +func (x *OnlineDDL) GetSql() string { + if x != nil { + return x.Sql + } + return "" +} + +func (x *OnlineDDL) GetUuid() string { + if x != nil { + return x.Uuid + } + return "" +} + +func (x *OnlineDDL) GetStrategy() OnlineDDL_Strategy { + if x != nil { + return x.Strategy + } + return OnlineDDL_VITESS +} + +func (x *OnlineDDL) GetOptions() string { + if x != nil { + return x.Options + } + return "" +} + +func (x *OnlineDDL) GetMigrationContext() string { + if x != nil { + return x.MigrationContext + } + return "" +} + +func (x *OnlineDDL) GetStatus() OnlineDDL_Status { + if x != nil { + return x.Status + } + return OnlineDDL_UNKNOWN +} + +func (x *OnlineDDL) GetTabletAlias() *topodata.TabletAlias { + if x != nil { + return x.TabletAlias + } + return nil +} + +func (x *OnlineDDL) GetRetries() int64 { + if x != nil { + return x.Retries + } + return 0 +} + +func (x *OnlineDDL) GetReadyToComplete() bool { + if x != nil { + return x.ReadyToComplete + } + return false +} + +func (x *OnlineDDL) GetWasReadyToComplete() bool { + if x != nil { + return x.WasReadyToComplete + } + return false +} + type TableDefinition struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -123,7 +396,7 @@ type TableDefinition struct { func (x *TableDefinition) Reset() { *x = TableDefinition{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[0] + mi := &file_tabletmanagerdata_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -136,7 +409,7 @@ func (x *TableDefinition) String() string { func (*TableDefinition) ProtoMessage() {} func (x *TableDefinition) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[0] + mi := &file_tabletmanagerdata_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -149,7 +422,7 @@ func (x *TableDefinition) ProtoReflect() protoreflect.Message { // Deprecated: Use TableDefinition.ProtoReflect.Descriptor instead. func (*TableDefinition) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{0} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{1} } func (x *TableDefinition) GetName() string { @@ -220,7 +493,7 @@ type SchemaDefinition struct { func (x *SchemaDefinition) Reset() { *x = SchemaDefinition{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[1] + mi := &file_tabletmanagerdata_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -233,7 +506,7 @@ func (x *SchemaDefinition) String() string { func (*SchemaDefinition) ProtoMessage() {} func (x *SchemaDefinition) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[1] + mi := &file_tabletmanagerdata_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -246,7 +519,7 @@ func (x *SchemaDefinition) ProtoReflect() protoreflect.Message { // Deprecated: Use SchemaDefinition.ProtoReflect.Descriptor instead. func (*SchemaDefinition) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{1} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{2} } func (x *SchemaDefinition) GetDatabaseSchema() string { @@ -277,7 +550,7 @@ type SchemaChangeResult struct { func (x *SchemaChangeResult) Reset() { *x = SchemaChangeResult{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[2] + mi := &file_tabletmanagerdata_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -290,7 +563,7 @@ func (x *SchemaChangeResult) String() string { func (*SchemaChangeResult) ProtoMessage() {} func (x *SchemaChangeResult) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[2] + mi := &file_tabletmanagerdata_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -303,7 +576,7 @@ func (x *SchemaChangeResult) ProtoReflect() protoreflect.Message { // Deprecated: Use SchemaChangeResult.ProtoReflect.Descriptor instead. func (*SchemaChangeResult) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{2} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{3} } func (x *SchemaChangeResult) GetBeforeSchema() *SchemaDefinition { @@ -337,7 +610,7 @@ type UserPermission struct { func (x *UserPermission) Reset() { *x = UserPermission{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[3] + mi := &file_tabletmanagerdata_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -350,7 +623,7 @@ func (x *UserPermission) String() string { func (*UserPermission) ProtoMessage() {} func (x *UserPermission) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[3] + mi := &file_tabletmanagerdata_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -363,7 +636,7 @@ func (x *UserPermission) ProtoReflect() protoreflect.Message { // Deprecated: Use UserPermission.ProtoReflect.Descriptor instead. func (*UserPermission) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{3} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{4} } func (x *UserPermission) GetHost() string { @@ -410,7 +683,7 @@ type DbPermission struct { func (x *DbPermission) Reset() { *x = DbPermission{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[4] + mi := &file_tabletmanagerdata_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -423,7 +696,7 @@ func (x *DbPermission) String() string { func (*DbPermission) ProtoMessage() {} func (x *DbPermission) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[4] + mi := &file_tabletmanagerdata_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -436,7 +709,7 @@ func (x *DbPermission) ProtoReflect() protoreflect.Message { // Deprecated: Use DbPermission.ProtoReflect.Descriptor instead. func (*DbPermission) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{4} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{5} } func (x *DbPermission) GetHost() string { @@ -481,7 +754,7 @@ type Permissions struct { func (x *Permissions) Reset() { *x = Permissions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[5] + mi := &file_tabletmanagerdata_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -494,7 +767,7 @@ func (x *Permissions) String() string { func (*Permissions) ProtoMessage() {} func (x *Permissions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[5] + mi := &file_tabletmanagerdata_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -507,7 +780,7 @@ func (x *Permissions) ProtoReflect() protoreflect.Message { // Deprecated: Use Permissions.ProtoReflect.Descriptor instead. func (*Permissions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{5} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{6} } func (x *Permissions) GetUserPermissions() []*UserPermission { @@ -535,7 +808,7 @@ type PingRequest struct { func (x *PingRequest) Reset() { *x = PingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[6] + mi := &file_tabletmanagerdata_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -548,7 +821,7 @@ func (x *PingRequest) String() string { func (*PingRequest) ProtoMessage() {} func (x *PingRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[6] + mi := &file_tabletmanagerdata_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -561,7 +834,7 @@ func (x *PingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PingRequest.ProtoReflect.Descriptor instead. func (*PingRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{6} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{7} } func (x *PingRequest) GetPayload() string { @@ -582,7 +855,7 @@ type PingResponse struct { func (x *PingResponse) Reset() { *x = PingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[7] + mi := &file_tabletmanagerdata_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -595,7 +868,7 @@ func (x *PingResponse) String() string { func (*PingResponse) ProtoMessage() {} func (x *PingResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[7] + mi := &file_tabletmanagerdata_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -608,7 +881,7 @@ func (x *PingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PingResponse.ProtoReflect.Descriptor instead. func (*PingResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{7} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{8} } func (x *PingResponse) GetPayload() string { @@ -630,7 +903,7 @@ type SleepRequest struct { func (x *SleepRequest) Reset() { *x = SleepRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[8] + mi := &file_tabletmanagerdata_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -643,7 +916,7 @@ func (x *SleepRequest) String() string { func (*SleepRequest) ProtoMessage() {} func (x *SleepRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[8] + mi := &file_tabletmanagerdata_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -656,7 +929,7 @@ func (x *SleepRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SleepRequest.ProtoReflect.Descriptor instead. func (*SleepRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{8} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{9} } func (x *SleepRequest) GetDuration() int64 { @@ -675,7 +948,7 @@ type SleepResponse struct { func (x *SleepResponse) Reset() { *x = SleepResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[9] + mi := &file_tabletmanagerdata_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -688,7 +961,7 @@ func (x *SleepResponse) String() string { func (*SleepResponse) ProtoMessage() {} func (x *SleepResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[9] + mi := &file_tabletmanagerdata_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -701,7 +974,7 @@ func (x *SleepResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SleepResponse.ProtoReflect.Descriptor instead. func (*SleepResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{9} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{10} } type ExecuteHookRequest struct { @@ -717,7 +990,7 @@ type ExecuteHookRequest struct { func (x *ExecuteHookRequest) Reset() { *x = ExecuteHookRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[10] + mi := &file_tabletmanagerdata_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -730,7 +1003,7 @@ func (x *ExecuteHookRequest) String() string { func (*ExecuteHookRequest) ProtoMessage() {} func (x *ExecuteHookRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[10] + mi := &file_tabletmanagerdata_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -743,7 +1016,7 @@ func (x *ExecuteHookRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteHookRequest.ProtoReflect.Descriptor instead. func (*ExecuteHookRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{10} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{11} } func (x *ExecuteHookRequest) GetName() string { @@ -780,7 +1053,7 @@ type ExecuteHookResponse struct { func (x *ExecuteHookResponse) Reset() { *x = ExecuteHookResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[11] + mi := &file_tabletmanagerdata_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -793,7 +1066,7 @@ func (x *ExecuteHookResponse) String() string { func (*ExecuteHookResponse) ProtoMessage() {} func (x *ExecuteHookResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[11] + mi := &file_tabletmanagerdata_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -806,7 +1079,7 @@ func (x *ExecuteHookResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteHookResponse.ProtoReflect.Descriptor instead. func (*ExecuteHookResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{11} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{12} } func (x *ExecuteHookResponse) GetExitStatus() int64 { @@ -846,7 +1119,7 @@ type GetSchemaRequest struct { func (x *GetSchemaRequest) Reset() { *x = GetSchemaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[12] + mi := &file_tabletmanagerdata_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -859,7 +1132,7 @@ func (x *GetSchemaRequest) String() string { func (*GetSchemaRequest) ProtoMessage() {} func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[12] + mi := &file_tabletmanagerdata_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -872,7 +1145,7 @@ func (x *GetSchemaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSchemaRequest.ProtoReflect.Descriptor instead. func (*GetSchemaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{12} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{13} } func (x *GetSchemaRequest) GetTables() []string { @@ -914,7 +1187,7 @@ type GetSchemaResponse struct { func (x *GetSchemaResponse) Reset() { *x = GetSchemaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[13] + mi := &file_tabletmanagerdata_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -927,7 +1200,7 @@ func (x *GetSchemaResponse) String() string { func (*GetSchemaResponse) ProtoMessage() {} func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[13] + mi := &file_tabletmanagerdata_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -940,7 +1213,7 @@ func (x *GetSchemaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSchemaResponse.ProtoReflect.Descriptor instead. func (*GetSchemaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{13} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{14} } func (x *GetSchemaResponse) GetSchemaDefinition() *SchemaDefinition { @@ -959,7 +1232,7 @@ type GetPermissionsRequest struct { func (x *GetPermissionsRequest) Reset() { *x = GetPermissionsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[14] + mi := &file_tabletmanagerdata_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -972,7 +1245,7 @@ func (x *GetPermissionsRequest) String() string { func (*GetPermissionsRequest) ProtoMessage() {} func (x *GetPermissionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[14] + mi := &file_tabletmanagerdata_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -985,7 +1258,7 @@ func (x *GetPermissionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetPermissionsRequest.ProtoReflect.Descriptor instead. func (*GetPermissionsRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{14} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{15} } type GetPermissionsResponse struct { @@ -999,7 +1272,7 @@ type GetPermissionsResponse struct { func (x *GetPermissionsResponse) Reset() { *x = GetPermissionsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[15] + mi := &file_tabletmanagerdata_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1012,7 +1285,7 @@ func (x *GetPermissionsResponse) String() string { func (*GetPermissionsResponse) ProtoMessage() {} func (x *GetPermissionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[15] + mi := &file_tabletmanagerdata_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1025,7 +1298,7 @@ func (x *GetPermissionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetPermissionsResponse.ProtoReflect.Descriptor instead. func (*GetPermissionsResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{15} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{16} } func (x *GetPermissionsResponse) GetPermissions() *Permissions { @@ -1044,7 +1317,7 @@ type SetReadOnlyRequest struct { func (x *SetReadOnlyRequest) Reset() { *x = SetReadOnlyRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[16] + mi := &file_tabletmanagerdata_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1057,7 +1330,7 @@ func (x *SetReadOnlyRequest) String() string { func (*SetReadOnlyRequest) ProtoMessage() {} func (x *SetReadOnlyRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[16] + mi := &file_tabletmanagerdata_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1070,7 +1343,7 @@ func (x *SetReadOnlyRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetReadOnlyRequest.ProtoReflect.Descriptor instead. func (*SetReadOnlyRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{16} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{17} } type SetReadOnlyResponse struct { @@ -1082,7 +1355,7 @@ type SetReadOnlyResponse struct { func (x *SetReadOnlyResponse) Reset() { *x = SetReadOnlyResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[17] + mi := &file_tabletmanagerdata_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1095,7 +1368,7 @@ func (x *SetReadOnlyResponse) String() string { func (*SetReadOnlyResponse) ProtoMessage() {} func (x *SetReadOnlyResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[17] + mi := &file_tabletmanagerdata_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1108,7 +1381,7 @@ func (x *SetReadOnlyResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetReadOnlyResponse.ProtoReflect.Descriptor instead. func (*SetReadOnlyResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{17} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{18} } type SetReadWriteRequest struct { @@ -1120,7 +1393,7 @@ type SetReadWriteRequest struct { func (x *SetReadWriteRequest) Reset() { *x = SetReadWriteRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[18] + mi := &file_tabletmanagerdata_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1133,7 +1406,7 @@ func (x *SetReadWriteRequest) String() string { func (*SetReadWriteRequest) ProtoMessage() {} func (x *SetReadWriteRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[18] + mi := &file_tabletmanagerdata_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1146,7 +1419,7 @@ func (x *SetReadWriteRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetReadWriteRequest.ProtoReflect.Descriptor instead. func (*SetReadWriteRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{18} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{19} } type SetReadWriteResponse struct { @@ -1158,7 +1431,7 @@ type SetReadWriteResponse struct { func (x *SetReadWriteResponse) Reset() { *x = SetReadWriteResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[19] + mi := &file_tabletmanagerdata_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1171,7 +1444,7 @@ func (x *SetReadWriteResponse) String() string { func (*SetReadWriteResponse) ProtoMessage() {} func (x *SetReadWriteResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[19] + mi := &file_tabletmanagerdata_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1184,7 +1457,7 @@ func (x *SetReadWriteResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetReadWriteResponse.ProtoReflect.Descriptor instead. func (*SetReadWriteResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{19} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{20} } type ChangeTypeRequest struct { @@ -1199,7 +1472,7 @@ type ChangeTypeRequest struct { func (x *ChangeTypeRequest) Reset() { *x = ChangeTypeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[20] + mi := &file_tabletmanagerdata_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1212,7 +1485,7 @@ func (x *ChangeTypeRequest) String() string { func (*ChangeTypeRequest) ProtoMessage() {} func (x *ChangeTypeRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[20] + mi := &file_tabletmanagerdata_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1225,7 +1498,7 @@ func (x *ChangeTypeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeTypeRequest.ProtoReflect.Descriptor instead. func (*ChangeTypeRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{20} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{21} } func (x *ChangeTypeRequest) GetTabletType() topodata.TabletType { @@ -1251,7 +1524,7 @@ type ChangeTypeResponse struct { func (x *ChangeTypeResponse) Reset() { *x = ChangeTypeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[21] + mi := &file_tabletmanagerdata_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1264,7 +1537,7 @@ func (x *ChangeTypeResponse) String() string { func (*ChangeTypeResponse) ProtoMessage() {} func (x *ChangeTypeResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[21] + mi := &file_tabletmanagerdata_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1277,7 +1550,7 @@ func (x *ChangeTypeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangeTypeResponse.ProtoReflect.Descriptor instead. func (*ChangeTypeResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{21} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{22} } type RefreshStateRequest struct { @@ -1289,7 +1562,7 @@ type RefreshStateRequest struct { func (x *RefreshStateRequest) Reset() { *x = RefreshStateRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[22] + mi := &file_tabletmanagerdata_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1302,7 +1575,7 @@ func (x *RefreshStateRequest) String() string { func (*RefreshStateRequest) ProtoMessage() {} func (x *RefreshStateRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[22] + mi := &file_tabletmanagerdata_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1315,7 +1588,7 @@ func (x *RefreshStateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RefreshStateRequest.ProtoReflect.Descriptor instead. func (*RefreshStateRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{22} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{23} } type RefreshStateResponse struct { @@ -1327,7 +1600,7 @@ type RefreshStateResponse struct { func (x *RefreshStateResponse) Reset() { *x = RefreshStateResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[23] + mi := &file_tabletmanagerdata_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1340,7 +1613,7 @@ func (x *RefreshStateResponse) String() string { func (*RefreshStateResponse) ProtoMessage() {} func (x *RefreshStateResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[23] + mi := &file_tabletmanagerdata_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1353,7 +1626,7 @@ func (x *RefreshStateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RefreshStateResponse.ProtoReflect.Descriptor instead. func (*RefreshStateResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{23} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{24} } type RunHealthCheckRequest struct { @@ -1365,7 +1638,7 @@ type RunHealthCheckRequest struct { func (x *RunHealthCheckRequest) Reset() { *x = RunHealthCheckRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[24] + mi := &file_tabletmanagerdata_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1378,7 +1651,7 @@ func (x *RunHealthCheckRequest) String() string { func (*RunHealthCheckRequest) ProtoMessage() {} func (x *RunHealthCheckRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[24] + mi := &file_tabletmanagerdata_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1391,7 +1664,7 @@ func (x *RunHealthCheckRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RunHealthCheckRequest.ProtoReflect.Descriptor instead. func (*RunHealthCheckRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{24} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{25} } type RunHealthCheckResponse struct { @@ -1403,7 +1676,7 @@ type RunHealthCheckResponse struct { func (x *RunHealthCheckResponse) Reset() { *x = RunHealthCheckResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[25] + mi := &file_tabletmanagerdata_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1416,7 +1689,7 @@ func (x *RunHealthCheckResponse) String() string { func (*RunHealthCheckResponse) ProtoMessage() {} func (x *RunHealthCheckResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[25] + mi := &file_tabletmanagerdata_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1429,7 +1702,7 @@ func (x *RunHealthCheckResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RunHealthCheckResponse.ProtoReflect.Descriptor instead. func (*RunHealthCheckResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{25} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{26} } type ReloadSchemaRequest struct { @@ -1446,7 +1719,7 @@ type ReloadSchemaRequest struct { func (x *ReloadSchemaRequest) Reset() { *x = ReloadSchemaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[26] + mi := &file_tabletmanagerdata_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1459,7 +1732,7 @@ func (x *ReloadSchemaRequest) String() string { func (*ReloadSchemaRequest) ProtoMessage() {} func (x *ReloadSchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[26] + mi := &file_tabletmanagerdata_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1472,7 +1745,7 @@ func (x *ReloadSchemaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReloadSchemaRequest.ProtoReflect.Descriptor instead. func (*ReloadSchemaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{26} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{27} } func (x *ReloadSchemaRequest) GetWaitPosition() string { @@ -1491,7 +1764,7 @@ type ReloadSchemaResponse struct { func (x *ReloadSchemaResponse) Reset() { *x = ReloadSchemaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[27] + mi := &file_tabletmanagerdata_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1504,7 +1777,7 @@ func (x *ReloadSchemaResponse) String() string { func (*ReloadSchemaResponse) ProtoMessage() {} func (x *ReloadSchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[27] + mi := &file_tabletmanagerdata_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1517,7 +1790,7 @@ func (x *ReloadSchemaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReloadSchemaResponse.ProtoReflect.Descriptor instead. func (*ReloadSchemaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{27} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{28} } type PreflightSchemaRequest struct { @@ -1531,7 +1804,7 @@ type PreflightSchemaRequest struct { func (x *PreflightSchemaRequest) Reset() { *x = PreflightSchemaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[28] + mi := &file_tabletmanagerdata_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1544,7 +1817,7 @@ func (x *PreflightSchemaRequest) String() string { func (*PreflightSchemaRequest) ProtoMessage() {} func (x *PreflightSchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[28] + mi := &file_tabletmanagerdata_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1557,7 +1830,7 @@ func (x *PreflightSchemaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PreflightSchemaRequest.ProtoReflect.Descriptor instead. func (*PreflightSchemaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{28} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{29} } func (x *PreflightSchemaRequest) GetChanges() []string { @@ -1580,7 +1853,7 @@ type PreflightSchemaResponse struct { func (x *PreflightSchemaResponse) Reset() { *x = PreflightSchemaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[29] + mi := &file_tabletmanagerdata_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1593,7 +1866,7 @@ func (x *PreflightSchemaResponse) String() string { func (*PreflightSchemaResponse) ProtoMessage() {} func (x *PreflightSchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[29] + mi := &file_tabletmanagerdata_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1606,7 +1879,7 @@ func (x *PreflightSchemaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PreflightSchemaResponse.ProtoReflect.Descriptor instead. func (*PreflightSchemaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{29} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{30} } func (x *PreflightSchemaResponse) GetChangeResults() []*SchemaChangeResult { @@ -1632,7 +1905,7 @@ type ApplySchemaRequest struct { func (x *ApplySchemaRequest) Reset() { *x = ApplySchemaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[30] + mi := &file_tabletmanagerdata_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1645,7 +1918,7 @@ func (x *ApplySchemaRequest) String() string { func (*ApplySchemaRequest) ProtoMessage() {} func (x *ApplySchemaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[30] + mi := &file_tabletmanagerdata_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1658,7 +1931,7 @@ func (x *ApplySchemaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplySchemaRequest.ProtoReflect.Descriptor instead. func (*ApplySchemaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{30} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{31} } func (x *ApplySchemaRequest) GetSql() string { @@ -1715,7 +1988,7 @@ type ApplySchemaResponse struct { func (x *ApplySchemaResponse) Reset() { *x = ApplySchemaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[31] + mi := &file_tabletmanagerdata_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1728,7 +2001,7 @@ func (x *ApplySchemaResponse) String() string { func (*ApplySchemaResponse) ProtoMessage() {} func (x *ApplySchemaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[31] + mi := &file_tabletmanagerdata_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1741,7 +2014,7 @@ func (x *ApplySchemaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ApplySchemaResponse.ProtoReflect.Descriptor instead. func (*ApplySchemaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{31} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{32} } func (x *ApplySchemaResponse) GetBeforeSchema() *SchemaDefinition { @@ -1767,7 +2040,7 @@ type LockTablesRequest struct { func (x *LockTablesRequest) Reset() { *x = LockTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[32] + mi := &file_tabletmanagerdata_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1780,7 +2053,7 @@ func (x *LockTablesRequest) String() string { func (*LockTablesRequest) ProtoMessage() {} func (x *LockTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[32] + mi := &file_tabletmanagerdata_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1793,7 +2066,7 @@ func (x *LockTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use LockTablesRequest.ProtoReflect.Descriptor instead. func (*LockTablesRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{32} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{33} } type LockTablesResponse struct { @@ -1805,7 +2078,7 @@ type LockTablesResponse struct { func (x *LockTablesResponse) Reset() { *x = LockTablesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[33] + mi := &file_tabletmanagerdata_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1818,7 +2091,7 @@ func (x *LockTablesResponse) String() string { func (*LockTablesResponse) ProtoMessage() {} func (x *LockTablesResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[33] + mi := &file_tabletmanagerdata_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1831,7 +2104,7 @@ func (x *LockTablesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use LockTablesResponse.ProtoReflect.Descriptor instead. func (*LockTablesResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{33} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{34} } type UnlockTablesRequest struct { @@ -1843,7 +2116,7 @@ type UnlockTablesRequest struct { func (x *UnlockTablesRequest) Reset() { *x = UnlockTablesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[34] + mi := &file_tabletmanagerdata_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1856,7 +2129,7 @@ func (x *UnlockTablesRequest) String() string { func (*UnlockTablesRequest) ProtoMessage() {} func (x *UnlockTablesRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[34] + mi := &file_tabletmanagerdata_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1869,7 +2142,7 @@ func (x *UnlockTablesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockTablesRequest.ProtoReflect.Descriptor instead. func (*UnlockTablesRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{34} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{35} } type UnlockTablesResponse struct { @@ -1881,7 +2154,7 @@ type UnlockTablesResponse struct { func (x *UnlockTablesResponse) Reset() { *x = UnlockTablesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[35] + mi := &file_tabletmanagerdata_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1894,7 +2167,7 @@ func (x *UnlockTablesResponse) String() string { func (*UnlockTablesResponse) ProtoMessage() {} func (x *UnlockTablesResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[35] + mi := &file_tabletmanagerdata_proto_msgTypes[36] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1907,7 +2180,7 @@ func (x *UnlockTablesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockTablesResponse.ProtoReflect.Descriptor instead. func (*UnlockTablesResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{35} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{36} } type ExecuteQueryRequest struct { @@ -1926,7 +2199,7 @@ type ExecuteQueryRequest struct { func (x *ExecuteQueryRequest) Reset() { *x = ExecuteQueryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[36] + mi := &file_tabletmanagerdata_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1939,7 +2212,7 @@ func (x *ExecuteQueryRequest) String() string { func (*ExecuteQueryRequest) ProtoMessage() {} func (x *ExecuteQueryRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[36] + mi := &file_tabletmanagerdata_proto_msgTypes[37] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1952,7 +2225,7 @@ func (x *ExecuteQueryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteQueryRequest.ProtoReflect.Descriptor instead. func (*ExecuteQueryRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{36} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{37} } func (x *ExecuteQueryRequest) GetQuery() []byte { @@ -1994,7 +2267,7 @@ type ExecuteQueryResponse struct { func (x *ExecuteQueryResponse) Reset() { *x = ExecuteQueryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[37] + mi := &file_tabletmanagerdata_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2007,7 +2280,7 @@ func (x *ExecuteQueryResponse) String() string { func (*ExecuteQueryResponse) ProtoMessage() {} func (x *ExecuteQueryResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[37] + mi := &file_tabletmanagerdata_proto_msgTypes[38] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2020,7 +2293,7 @@ func (x *ExecuteQueryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteQueryResponse.ProtoReflect.Descriptor instead. func (*ExecuteQueryResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{37} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{38} } func (x *ExecuteQueryResponse) GetResult() *query.QueryResult { @@ -2045,7 +2318,7 @@ type ExecuteFetchAsDbaRequest struct { func (x *ExecuteFetchAsDbaRequest) Reset() { *x = ExecuteFetchAsDbaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[38] + mi := &file_tabletmanagerdata_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2058,7 +2331,7 @@ func (x *ExecuteFetchAsDbaRequest) String() string { func (*ExecuteFetchAsDbaRequest) ProtoMessage() {} func (x *ExecuteFetchAsDbaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[38] + mi := &file_tabletmanagerdata_proto_msgTypes[39] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2071,7 +2344,7 @@ func (x *ExecuteFetchAsDbaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteFetchAsDbaRequest.ProtoReflect.Descriptor instead. func (*ExecuteFetchAsDbaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{38} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{39} } func (x *ExecuteFetchAsDbaRequest) GetQuery() []byte { @@ -2120,7 +2393,7 @@ type ExecuteFetchAsDbaResponse struct { func (x *ExecuteFetchAsDbaResponse) Reset() { *x = ExecuteFetchAsDbaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[39] + mi := &file_tabletmanagerdata_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2133,7 +2406,7 @@ func (x *ExecuteFetchAsDbaResponse) String() string { func (*ExecuteFetchAsDbaResponse) ProtoMessage() {} func (x *ExecuteFetchAsDbaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[39] + mi := &file_tabletmanagerdata_proto_msgTypes[40] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2146,7 +2419,7 @@ func (x *ExecuteFetchAsDbaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteFetchAsDbaResponse.ProtoReflect.Descriptor instead. func (*ExecuteFetchAsDbaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{39} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{40} } func (x *ExecuteFetchAsDbaResponse) GetResult() *query.QueryResult { @@ -2170,7 +2443,7 @@ type ExecuteFetchAsAllPrivsRequest struct { func (x *ExecuteFetchAsAllPrivsRequest) Reset() { *x = ExecuteFetchAsAllPrivsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[40] + mi := &file_tabletmanagerdata_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2183,7 +2456,7 @@ func (x *ExecuteFetchAsAllPrivsRequest) String() string { func (*ExecuteFetchAsAllPrivsRequest) ProtoMessage() {} func (x *ExecuteFetchAsAllPrivsRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[40] + mi := &file_tabletmanagerdata_proto_msgTypes[41] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2196,7 +2469,7 @@ func (x *ExecuteFetchAsAllPrivsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteFetchAsAllPrivsRequest.ProtoReflect.Descriptor instead. func (*ExecuteFetchAsAllPrivsRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{40} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{41} } func (x *ExecuteFetchAsAllPrivsRequest) GetQuery() []byte { @@ -2238,7 +2511,7 @@ type ExecuteFetchAsAllPrivsResponse struct { func (x *ExecuteFetchAsAllPrivsResponse) Reset() { *x = ExecuteFetchAsAllPrivsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[41] + mi := &file_tabletmanagerdata_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2251,7 +2524,7 @@ func (x *ExecuteFetchAsAllPrivsResponse) String() string { func (*ExecuteFetchAsAllPrivsResponse) ProtoMessage() {} func (x *ExecuteFetchAsAllPrivsResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[41] + mi := &file_tabletmanagerdata_proto_msgTypes[42] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2264,7 +2537,7 @@ func (x *ExecuteFetchAsAllPrivsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteFetchAsAllPrivsResponse.ProtoReflect.Descriptor instead. func (*ExecuteFetchAsAllPrivsResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{41} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{42} } func (x *ExecuteFetchAsAllPrivsResponse) GetResult() *query.QueryResult { @@ -2286,7 +2559,7 @@ type ExecuteFetchAsAppRequest struct { func (x *ExecuteFetchAsAppRequest) Reset() { *x = ExecuteFetchAsAppRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[42] + mi := &file_tabletmanagerdata_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2299,7 +2572,7 @@ func (x *ExecuteFetchAsAppRequest) String() string { func (*ExecuteFetchAsAppRequest) ProtoMessage() {} func (x *ExecuteFetchAsAppRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[42] + mi := &file_tabletmanagerdata_proto_msgTypes[43] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2312,7 +2585,7 @@ func (x *ExecuteFetchAsAppRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteFetchAsAppRequest.ProtoReflect.Descriptor instead. func (*ExecuteFetchAsAppRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{42} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{43} } func (x *ExecuteFetchAsAppRequest) GetQuery() []byte { @@ -2340,7 +2613,7 @@ type ExecuteFetchAsAppResponse struct { func (x *ExecuteFetchAsAppResponse) Reset() { *x = ExecuteFetchAsAppResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[43] + mi := &file_tabletmanagerdata_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2353,7 +2626,7 @@ func (x *ExecuteFetchAsAppResponse) String() string { func (*ExecuteFetchAsAppResponse) ProtoMessage() {} func (x *ExecuteFetchAsAppResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[43] + mi := &file_tabletmanagerdata_proto_msgTypes[44] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2366,7 +2639,7 @@ func (x *ExecuteFetchAsAppResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ExecuteFetchAsAppResponse.ProtoReflect.Descriptor instead. func (*ExecuteFetchAsAppResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{43} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{44} } func (x *ExecuteFetchAsAppResponse) GetResult() *query.QueryResult { @@ -2385,7 +2658,7 @@ type ReplicationStatusRequest struct { func (x *ReplicationStatusRequest) Reset() { *x = ReplicationStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[44] + mi := &file_tabletmanagerdata_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2398,7 +2671,7 @@ func (x *ReplicationStatusRequest) String() string { func (*ReplicationStatusRequest) ProtoMessage() {} func (x *ReplicationStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[44] + mi := &file_tabletmanagerdata_proto_msgTypes[45] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2411,7 +2684,7 @@ func (x *ReplicationStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplicationStatusRequest.ProtoReflect.Descriptor instead. func (*ReplicationStatusRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{44} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{45} } type ReplicationStatusResponse struct { @@ -2425,7 +2698,7 @@ type ReplicationStatusResponse struct { func (x *ReplicationStatusResponse) Reset() { *x = ReplicationStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[45] + mi := &file_tabletmanagerdata_proto_msgTypes[46] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2438,7 +2711,7 @@ func (x *ReplicationStatusResponse) String() string { func (*ReplicationStatusResponse) ProtoMessage() {} func (x *ReplicationStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[45] + mi := &file_tabletmanagerdata_proto_msgTypes[46] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2451,7 +2724,7 @@ func (x *ReplicationStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplicationStatusResponse.ProtoReflect.Descriptor instead. func (*ReplicationStatusResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{45} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{46} } func (x *ReplicationStatusResponse) GetStatus() *replicationdata.Status { @@ -2470,7 +2743,7 @@ type PrimaryStatusRequest struct { func (x *PrimaryStatusRequest) Reset() { *x = PrimaryStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[46] + mi := &file_tabletmanagerdata_proto_msgTypes[47] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2483,7 +2756,7 @@ func (x *PrimaryStatusRequest) String() string { func (*PrimaryStatusRequest) ProtoMessage() {} func (x *PrimaryStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[46] + mi := &file_tabletmanagerdata_proto_msgTypes[47] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2496,7 +2769,7 @@ func (x *PrimaryStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryStatusRequest.ProtoReflect.Descriptor instead. func (*PrimaryStatusRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{46} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{47} } type PrimaryStatusResponse struct { @@ -2510,7 +2783,7 @@ type PrimaryStatusResponse struct { func (x *PrimaryStatusResponse) Reset() { *x = PrimaryStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[47] + mi := &file_tabletmanagerdata_proto_msgTypes[48] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2523,7 +2796,7 @@ func (x *PrimaryStatusResponse) String() string { func (*PrimaryStatusResponse) ProtoMessage() {} func (x *PrimaryStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[47] + mi := &file_tabletmanagerdata_proto_msgTypes[48] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2536,7 +2809,7 @@ func (x *PrimaryStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryStatusResponse.ProtoReflect.Descriptor instead. func (*PrimaryStatusResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{47} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{48} } func (x *PrimaryStatusResponse) GetStatus() *replicationdata.PrimaryStatus { @@ -2555,7 +2828,7 @@ type PrimaryPositionRequest struct { func (x *PrimaryPositionRequest) Reset() { *x = PrimaryPositionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[48] + mi := &file_tabletmanagerdata_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2568,7 +2841,7 @@ func (x *PrimaryPositionRequest) String() string { func (*PrimaryPositionRequest) ProtoMessage() {} func (x *PrimaryPositionRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[48] + mi := &file_tabletmanagerdata_proto_msgTypes[49] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2581,7 +2854,7 @@ func (x *PrimaryPositionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryPositionRequest.ProtoReflect.Descriptor instead. func (*PrimaryPositionRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{48} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{49} } type PrimaryPositionResponse struct { @@ -2595,7 +2868,7 @@ type PrimaryPositionResponse struct { func (x *PrimaryPositionResponse) Reset() { *x = PrimaryPositionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[49] + mi := &file_tabletmanagerdata_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2608,7 +2881,7 @@ func (x *PrimaryPositionResponse) String() string { func (*PrimaryPositionResponse) ProtoMessage() {} func (x *PrimaryPositionResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[49] + mi := &file_tabletmanagerdata_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2621,7 +2894,7 @@ func (x *PrimaryPositionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryPositionResponse.ProtoReflect.Descriptor instead. func (*PrimaryPositionResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{49} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{50} } func (x *PrimaryPositionResponse) GetPosition() string { @@ -2642,7 +2915,7 @@ type WaitForPositionRequest struct { func (x *WaitForPositionRequest) Reset() { *x = WaitForPositionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[50] + mi := &file_tabletmanagerdata_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2655,7 +2928,7 @@ func (x *WaitForPositionRequest) String() string { func (*WaitForPositionRequest) ProtoMessage() {} func (x *WaitForPositionRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[50] + mi := &file_tabletmanagerdata_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2668,7 +2941,7 @@ func (x *WaitForPositionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use WaitForPositionRequest.ProtoReflect.Descriptor instead. func (*WaitForPositionRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{50} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{51} } func (x *WaitForPositionRequest) GetPosition() string { @@ -2687,7 +2960,7 @@ type WaitForPositionResponse struct { func (x *WaitForPositionResponse) Reset() { *x = WaitForPositionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[51] + mi := &file_tabletmanagerdata_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2700,7 +2973,7 @@ func (x *WaitForPositionResponse) String() string { func (*WaitForPositionResponse) ProtoMessage() {} func (x *WaitForPositionResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[51] + mi := &file_tabletmanagerdata_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2713,7 +2986,7 @@ func (x *WaitForPositionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use WaitForPositionResponse.ProtoReflect.Descriptor instead. func (*WaitForPositionResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{51} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{52} } type StopReplicationRequest struct { @@ -2725,7 +2998,7 @@ type StopReplicationRequest struct { func (x *StopReplicationRequest) Reset() { *x = StopReplicationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[52] + mi := &file_tabletmanagerdata_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2738,7 +3011,7 @@ func (x *StopReplicationRequest) String() string { func (*StopReplicationRequest) ProtoMessage() {} func (x *StopReplicationRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[52] + mi := &file_tabletmanagerdata_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2751,7 +3024,7 @@ func (x *StopReplicationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopReplicationRequest.ProtoReflect.Descriptor instead. func (*StopReplicationRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{52} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{53} } type StopReplicationResponse struct { @@ -2763,7 +3036,7 @@ type StopReplicationResponse struct { func (x *StopReplicationResponse) Reset() { *x = StopReplicationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[53] + mi := &file_tabletmanagerdata_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2776,7 +3049,7 @@ func (x *StopReplicationResponse) String() string { func (*StopReplicationResponse) ProtoMessage() {} func (x *StopReplicationResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[53] + mi := &file_tabletmanagerdata_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2789,7 +3062,7 @@ func (x *StopReplicationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopReplicationResponse.ProtoReflect.Descriptor instead. func (*StopReplicationResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{53} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{54} } type StopReplicationMinimumRequest struct { @@ -2804,7 +3077,7 @@ type StopReplicationMinimumRequest struct { func (x *StopReplicationMinimumRequest) Reset() { *x = StopReplicationMinimumRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[54] + mi := &file_tabletmanagerdata_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2817,7 +3090,7 @@ func (x *StopReplicationMinimumRequest) String() string { func (*StopReplicationMinimumRequest) ProtoMessage() {} func (x *StopReplicationMinimumRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[54] + mi := &file_tabletmanagerdata_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2830,7 +3103,7 @@ func (x *StopReplicationMinimumRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StopReplicationMinimumRequest.ProtoReflect.Descriptor instead. func (*StopReplicationMinimumRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{54} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{55} } func (x *StopReplicationMinimumRequest) GetPosition() string { @@ -2858,7 +3131,7 @@ type StopReplicationMinimumResponse struct { func (x *StopReplicationMinimumResponse) Reset() { *x = StopReplicationMinimumResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[55] + mi := &file_tabletmanagerdata_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2871,7 +3144,7 @@ func (x *StopReplicationMinimumResponse) String() string { func (*StopReplicationMinimumResponse) ProtoMessage() {} func (x *StopReplicationMinimumResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[55] + mi := &file_tabletmanagerdata_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2884,7 +3157,7 @@ func (x *StopReplicationMinimumResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StopReplicationMinimumResponse.ProtoReflect.Descriptor instead. func (*StopReplicationMinimumResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{55} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{56} } func (x *StopReplicationMinimumResponse) GetPosition() string { @@ -2905,7 +3178,7 @@ type StartReplicationRequest struct { func (x *StartReplicationRequest) Reset() { *x = StartReplicationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[56] + mi := &file_tabletmanagerdata_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2918,7 +3191,7 @@ func (x *StartReplicationRequest) String() string { func (*StartReplicationRequest) ProtoMessage() {} func (x *StartReplicationRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[56] + mi := &file_tabletmanagerdata_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2931,7 +3204,7 @@ func (x *StartReplicationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StartReplicationRequest.ProtoReflect.Descriptor instead. func (*StartReplicationRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{56} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{57} } func (x *StartReplicationRequest) GetSemiSync() bool { @@ -2950,7 +3223,7 @@ type StartReplicationResponse struct { func (x *StartReplicationResponse) Reset() { *x = StartReplicationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[57] + mi := &file_tabletmanagerdata_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2963,7 +3236,7 @@ func (x *StartReplicationResponse) String() string { func (*StartReplicationResponse) ProtoMessage() {} func (x *StartReplicationResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[57] + mi := &file_tabletmanagerdata_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2976,7 +3249,7 @@ func (x *StartReplicationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StartReplicationResponse.ProtoReflect.Descriptor instead. func (*StartReplicationResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{57} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{58} } type StartReplicationUntilAfterRequest struct { @@ -2991,7 +3264,7 @@ type StartReplicationUntilAfterRequest struct { func (x *StartReplicationUntilAfterRequest) Reset() { *x = StartReplicationUntilAfterRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[58] + mi := &file_tabletmanagerdata_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3004,7 +3277,7 @@ func (x *StartReplicationUntilAfterRequest) String() string { func (*StartReplicationUntilAfterRequest) ProtoMessage() {} func (x *StartReplicationUntilAfterRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[58] + mi := &file_tabletmanagerdata_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3017,7 +3290,7 @@ func (x *StartReplicationUntilAfterRequest) ProtoReflect() protoreflect.Message // Deprecated: Use StartReplicationUntilAfterRequest.ProtoReflect.Descriptor instead. func (*StartReplicationUntilAfterRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{58} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{59} } func (x *StartReplicationUntilAfterRequest) GetPosition() string { @@ -3043,7 +3316,7 @@ type StartReplicationUntilAfterResponse struct { func (x *StartReplicationUntilAfterResponse) Reset() { *x = StartReplicationUntilAfterResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[59] + mi := &file_tabletmanagerdata_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3056,7 +3329,7 @@ func (x *StartReplicationUntilAfterResponse) String() string { func (*StartReplicationUntilAfterResponse) ProtoMessage() {} func (x *StartReplicationUntilAfterResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[59] + mi := &file_tabletmanagerdata_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3069,7 +3342,7 @@ func (x *StartReplicationUntilAfterResponse) ProtoReflect() protoreflect.Message // Deprecated: Use StartReplicationUntilAfterResponse.ProtoReflect.Descriptor instead. func (*StartReplicationUntilAfterResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{59} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{60} } type GetReplicasRequest struct { @@ -3081,7 +3354,7 @@ type GetReplicasRequest struct { func (x *GetReplicasRequest) Reset() { *x = GetReplicasRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[60] + mi := &file_tabletmanagerdata_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3094,7 +3367,7 @@ func (x *GetReplicasRequest) String() string { func (*GetReplicasRequest) ProtoMessage() {} func (x *GetReplicasRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[60] + mi := &file_tabletmanagerdata_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3107,7 +3380,7 @@ func (x *GetReplicasRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetReplicasRequest.ProtoReflect.Descriptor instead. func (*GetReplicasRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{60} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{61} } type GetReplicasResponse struct { @@ -3121,7 +3394,7 @@ type GetReplicasResponse struct { func (x *GetReplicasResponse) Reset() { *x = GetReplicasResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[61] + mi := &file_tabletmanagerdata_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3134,7 +3407,7 @@ func (x *GetReplicasResponse) String() string { func (*GetReplicasResponse) ProtoMessage() {} func (x *GetReplicasResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[61] + mi := &file_tabletmanagerdata_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3147,7 +3420,7 @@ func (x *GetReplicasResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetReplicasResponse.ProtoReflect.Descriptor instead. func (*GetReplicasResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{61} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{62} } func (x *GetReplicasResponse) GetAddrs() []string { @@ -3166,7 +3439,7 @@ type ResetReplicationRequest struct { func (x *ResetReplicationRequest) Reset() { *x = ResetReplicationRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[62] + mi := &file_tabletmanagerdata_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3179,7 +3452,7 @@ func (x *ResetReplicationRequest) String() string { func (*ResetReplicationRequest) ProtoMessage() {} func (x *ResetReplicationRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[62] + mi := &file_tabletmanagerdata_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3192,7 +3465,7 @@ func (x *ResetReplicationRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetReplicationRequest.ProtoReflect.Descriptor instead. func (*ResetReplicationRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{62} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{63} } type ResetReplicationResponse struct { @@ -3204,7 +3477,7 @@ type ResetReplicationResponse struct { func (x *ResetReplicationResponse) Reset() { *x = ResetReplicationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[63] + mi := &file_tabletmanagerdata_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3217,7 +3490,7 @@ func (x *ResetReplicationResponse) String() string { func (*ResetReplicationResponse) ProtoMessage() {} func (x *ResetReplicationResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[63] + mi := &file_tabletmanagerdata_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3230,7 +3503,7 @@ func (x *ResetReplicationResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetReplicationResponse.ProtoReflect.Descriptor instead. func (*ResetReplicationResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{63} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{64} } type VReplicationExecRequest struct { @@ -3244,7 +3517,7 @@ type VReplicationExecRequest struct { func (x *VReplicationExecRequest) Reset() { *x = VReplicationExecRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[64] + mi := &file_tabletmanagerdata_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3257,7 +3530,7 @@ func (x *VReplicationExecRequest) String() string { func (*VReplicationExecRequest) ProtoMessage() {} func (x *VReplicationExecRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[64] + mi := &file_tabletmanagerdata_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3270,7 +3543,7 @@ func (x *VReplicationExecRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VReplicationExecRequest.ProtoReflect.Descriptor instead. func (*VReplicationExecRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{64} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{65} } func (x *VReplicationExecRequest) GetQuery() string { @@ -3291,7 +3564,7 @@ type VReplicationExecResponse struct { func (x *VReplicationExecResponse) Reset() { *x = VReplicationExecResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[65] + mi := &file_tabletmanagerdata_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3304,7 +3577,7 @@ func (x *VReplicationExecResponse) String() string { func (*VReplicationExecResponse) ProtoMessage() {} func (x *VReplicationExecResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[65] + mi := &file_tabletmanagerdata_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3317,7 +3590,7 @@ func (x *VReplicationExecResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VReplicationExecResponse.ProtoReflect.Descriptor instead. func (*VReplicationExecResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{65} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{66} } func (x *VReplicationExecResponse) GetResult() *query.QueryResult { @@ -3339,7 +3612,7 @@ type VReplicationWaitForPosRequest struct { func (x *VReplicationWaitForPosRequest) Reset() { *x = VReplicationWaitForPosRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[66] + mi := &file_tabletmanagerdata_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3352,7 +3625,7 @@ func (x *VReplicationWaitForPosRequest) String() string { func (*VReplicationWaitForPosRequest) ProtoMessage() {} func (x *VReplicationWaitForPosRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[66] + mi := &file_tabletmanagerdata_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3365,7 +3638,7 @@ func (x *VReplicationWaitForPosRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VReplicationWaitForPosRequest.ProtoReflect.Descriptor instead. func (*VReplicationWaitForPosRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{66} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{67} } func (x *VReplicationWaitForPosRequest) GetId() int32 { @@ -3391,7 +3664,7 @@ type VReplicationWaitForPosResponse struct { func (x *VReplicationWaitForPosResponse) Reset() { *x = VReplicationWaitForPosResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[67] + mi := &file_tabletmanagerdata_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3404,7 +3677,7 @@ func (x *VReplicationWaitForPosResponse) String() string { func (*VReplicationWaitForPosResponse) ProtoMessage() {} func (x *VReplicationWaitForPosResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[67] + mi := &file_tabletmanagerdata_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3417,7 +3690,7 @@ func (x *VReplicationWaitForPosResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VReplicationWaitForPosResponse.ProtoReflect.Descriptor instead. func (*VReplicationWaitForPosResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{67} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{68} } type InitPrimaryRequest struct { @@ -3431,7 +3704,7 @@ type InitPrimaryRequest struct { func (x *InitPrimaryRequest) Reset() { *x = InitPrimaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[68] + mi := &file_tabletmanagerdata_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3444,7 +3717,7 @@ func (x *InitPrimaryRequest) String() string { func (*InitPrimaryRequest) ProtoMessage() {} func (x *InitPrimaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[68] + mi := &file_tabletmanagerdata_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3457,7 +3730,7 @@ func (x *InitPrimaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InitPrimaryRequest.ProtoReflect.Descriptor instead. func (*InitPrimaryRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{68} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{69} } func (x *InitPrimaryRequest) GetSemiSync() bool { @@ -3478,7 +3751,7 @@ type InitPrimaryResponse struct { func (x *InitPrimaryResponse) Reset() { *x = InitPrimaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[69] + mi := &file_tabletmanagerdata_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3491,7 +3764,7 @@ func (x *InitPrimaryResponse) String() string { func (*InitPrimaryResponse) ProtoMessage() {} func (x *InitPrimaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[69] + mi := &file_tabletmanagerdata_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3504,7 +3777,7 @@ func (x *InitPrimaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InitPrimaryResponse.ProtoReflect.Descriptor instead. func (*InitPrimaryResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{69} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{70} } func (x *InitPrimaryResponse) GetPosition() string { @@ -3528,7 +3801,7 @@ type PopulateReparentJournalRequest struct { func (x *PopulateReparentJournalRequest) Reset() { *x = PopulateReparentJournalRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[70] + mi := &file_tabletmanagerdata_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3541,7 +3814,7 @@ func (x *PopulateReparentJournalRequest) String() string { func (*PopulateReparentJournalRequest) ProtoMessage() {} func (x *PopulateReparentJournalRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[70] + mi := &file_tabletmanagerdata_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3554,7 +3827,7 @@ func (x *PopulateReparentJournalRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PopulateReparentJournalRequest.ProtoReflect.Descriptor instead. func (*PopulateReparentJournalRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{70} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{71} } func (x *PopulateReparentJournalRequest) GetTimeCreatedNs() int64 { @@ -3594,7 +3867,7 @@ type PopulateReparentJournalResponse struct { func (x *PopulateReparentJournalResponse) Reset() { *x = PopulateReparentJournalResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[71] + mi := &file_tabletmanagerdata_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3607,7 +3880,7 @@ func (x *PopulateReparentJournalResponse) String() string { func (*PopulateReparentJournalResponse) ProtoMessage() {} func (x *PopulateReparentJournalResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[71] + mi := &file_tabletmanagerdata_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3620,7 +3893,7 @@ func (x *PopulateReparentJournalResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PopulateReparentJournalResponse.ProtoReflect.Descriptor instead. func (*PopulateReparentJournalResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{71} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{72} } type InitReplicaRequest struct { @@ -3637,7 +3910,7 @@ type InitReplicaRequest struct { func (x *InitReplicaRequest) Reset() { *x = InitReplicaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[72] + mi := &file_tabletmanagerdata_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3650,7 +3923,7 @@ func (x *InitReplicaRequest) String() string { func (*InitReplicaRequest) ProtoMessage() {} func (x *InitReplicaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[72] + mi := &file_tabletmanagerdata_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3663,7 +3936,7 @@ func (x *InitReplicaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use InitReplicaRequest.ProtoReflect.Descriptor instead. func (*InitReplicaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{72} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{73} } func (x *InitReplicaRequest) GetParent() *topodata.TabletAlias { @@ -3703,7 +3976,7 @@ type InitReplicaResponse struct { func (x *InitReplicaResponse) Reset() { *x = InitReplicaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[73] + mi := &file_tabletmanagerdata_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3716,7 +3989,7 @@ func (x *InitReplicaResponse) String() string { func (*InitReplicaResponse) ProtoMessage() {} func (x *InitReplicaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[73] + mi := &file_tabletmanagerdata_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3729,7 +4002,7 @@ func (x *InitReplicaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use InitReplicaResponse.ProtoReflect.Descriptor instead. func (*InitReplicaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{73} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{74} } type DemotePrimaryRequest struct { @@ -3741,7 +4014,7 @@ type DemotePrimaryRequest struct { func (x *DemotePrimaryRequest) Reset() { *x = DemotePrimaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[74] + mi := &file_tabletmanagerdata_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3754,7 +4027,7 @@ func (x *DemotePrimaryRequest) String() string { func (*DemotePrimaryRequest) ProtoMessage() {} func (x *DemotePrimaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[74] + mi := &file_tabletmanagerdata_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3767,7 +4040,7 @@ func (x *DemotePrimaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DemotePrimaryRequest.ProtoReflect.Descriptor instead. func (*DemotePrimaryRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{74} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{75} } type DemotePrimaryResponse struct { @@ -3782,7 +4055,7 @@ type DemotePrimaryResponse struct { func (x *DemotePrimaryResponse) Reset() { *x = DemotePrimaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[75] + mi := &file_tabletmanagerdata_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3795,7 +4068,7 @@ func (x *DemotePrimaryResponse) String() string { func (*DemotePrimaryResponse) ProtoMessage() {} func (x *DemotePrimaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[75] + mi := &file_tabletmanagerdata_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3808,7 +4081,7 @@ func (x *DemotePrimaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DemotePrimaryResponse.ProtoReflect.Descriptor instead. func (*DemotePrimaryResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{75} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{76} } func (x *DemotePrimaryResponse) GetPrimaryStatus() *replicationdata.PrimaryStatus { @@ -3829,7 +4102,7 @@ type UndoDemotePrimaryRequest struct { func (x *UndoDemotePrimaryRequest) Reset() { *x = UndoDemotePrimaryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[76] + mi := &file_tabletmanagerdata_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3842,7 +4115,7 @@ func (x *UndoDemotePrimaryRequest) String() string { func (*UndoDemotePrimaryRequest) ProtoMessage() {} func (x *UndoDemotePrimaryRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[76] + mi := &file_tabletmanagerdata_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3855,7 +4128,7 @@ func (x *UndoDemotePrimaryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UndoDemotePrimaryRequest.ProtoReflect.Descriptor instead. func (*UndoDemotePrimaryRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{76} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{77} } func (x *UndoDemotePrimaryRequest) GetSemiSync() bool { @@ -3874,7 +4147,7 @@ type UndoDemotePrimaryResponse struct { func (x *UndoDemotePrimaryResponse) Reset() { *x = UndoDemotePrimaryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[77] + mi := &file_tabletmanagerdata_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3887,7 +4160,7 @@ func (x *UndoDemotePrimaryResponse) String() string { func (*UndoDemotePrimaryResponse) ProtoMessage() {} func (x *UndoDemotePrimaryResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[77] + mi := &file_tabletmanagerdata_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3900,7 +4173,7 @@ func (x *UndoDemotePrimaryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UndoDemotePrimaryResponse.ProtoReflect.Descriptor instead. func (*UndoDemotePrimaryResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{77} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{78} } type ReplicaWasPromotedRequest struct { @@ -3912,7 +4185,7 @@ type ReplicaWasPromotedRequest struct { func (x *ReplicaWasPromotedRequest) Reset() { *x = ReplicaWasPromotedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[78] + mi := &file_tabletmanagerdata_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3925,7 +4198,7 @@ func (x *ReplicaWasPromotedRequest) String() string { func (*ReplicaWasPromotedRequest) ProtoMessage() {} func (x *ReplicaWasPromotedRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[78] + mi := &file_tabletmanagerdata_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3938,7 +4211,7 @@ func (x *ReplicaWasPromotedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplicaWasPromotedRequest.ProtoReflect.Descriptor instead. func (*ReplicaWasPromotedRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{78} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{79} } type ReplicaWasPromotedResponse struct { @@ -3950,7 +4223,7 @@ type ReplicaWasPromotedResponse struct { func (x *ReplicaWasPromotedResponse) Reset() { *x = ReplicaWasPromotedResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[79] + mi := &file_tabletmanagerdata_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3963,7 +4236,7 @@ func (x *ReplicaWasPromotedResponse) String() string { func (*ReplicaWasPromotedResponse) ProtoMessage() {} func (x *ReplicaWasPromotedResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[79] + mi := &file_tabletmanagerdata_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3976,7 +4249,7 @@ func (x *ReplicaWasPromotedResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplicaWasPromotedResponse.ProtoReflect.Descriptor instead. func (*ReplicaWasPromotedResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{79} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{80} } type ResetReplicationParametersRequest struct { @@ -3988,7 +4261,7 @@ type ResetReplicationParametersRequest struct { func (x *ResetReplicationParametersRequest) Reset() { *x = ResetReplicationParametersRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[80] + mi := &file_tabletmanagerdata_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4001,7 +4274,7 @@ func (x *ResetReplicationParametersRequest) String() string { func (*ResetReplicationParametersRequest) ProtoMessage() {} func (x *ResetReplicationParametersRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[80] + mi := &file_tabletmanagerdata_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4014,7 +4287,7 @@ func (x *ResetReplicationParametersRequest) ProtoReflect() protoreflect.Message // Deprecated: Use ResetReplicationParametersRequest.ProtoReflect.Descriptor instead. func (*ResetReplicationParametersRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{80} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{81} } type ResetReplicationParametersResponse struct { @@ -4026,7 +4299,7 @@ type ResetReplicationParametersResponse struct { func (x *ResetReplicationParametersResponse) Reset() { *x = ResetReplicationParametersResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[81] + mi := &file_tabletmanagerdata_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4039,7 +4312,7 @@ func (x *ResetReplicationParametersResponse) String() string { func (*ResetReplicationParametersResponse) ProtoMessage() {} func (x *ResetReplicationParametersResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[81] + mi := &file_tabletmanagerdata_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4052,7 +4325,7 @@ func (x *ResetReplicationParametersResponse) ProtoReflect() protoreflect.Message // Deprecated: Use ResetReplicationParametersResponse.ProtoReflect.Descriptor instead. func (*ResetReplicationParametersResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{81} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{82} } type FullStatusRequest struct { @@ -4064,7 +4337,7 @@ type FullStatusRequest struct { func (x *FullStatusRequest) Reset() { *x = FullStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[82] + mi := &file_tabletmanagerdata_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4077,7 +4350,7 @@ func (x *FullStatusRequest) String() string { func (*FullStatusRequest) ProtoMessage() {} func (x *FullStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[82] + mi := &file_tabletmanagerdata_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4090,7 +4363,7 @@ func (x *FullStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FullStatusRequest.ProtoReflect.Descriptor instead. func (*FullStatusRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{82} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{83} } type FullStatusResponse struct { @@ -4104,7 +4377,7 @@ type FullStatusResponse struct { func (x *FullStatusResponse) Reset() { *x = FullStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[83] + mi := &file_tabletmanagerdata_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4117,7 +4390,7 @@ func (x *FullStatusResponse) String() string { func (*FullStatusResponse) ProtoMessage() {} func (x *FullStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[83] + mi := &file_tabletmanagerdata_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4130,7 +4403,7 @@ func (x *FullStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FullStatusResponse.ProtoReflect.Descriptor instead. func (*FullStatusResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{83} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{84} } func (x *FullStatusResponse) GetStatus() *replicationdata.FullStatus { @@ -4155,7 +4428,7 @@ type SetReplicationSourceRequest struct { func (x *SetReplicationSourceRequest) Reset() { *x = SetReplicationSourceRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[84] + mi := &file_tabletmanagerdata_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4168,7 +4441,7 @@ func (x *SetReplicationSourceRequest) String() string { func (*SetReplicationSourceRequest) ProtoMessage() {} func (x *SetReplicationSourceRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[84] + mi := &file_tabletmanagerdata_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4181,7 +4454,7 @@ func (x *SetReplicationSourceRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetReplicationSourceRequest.ProtoReflect.Descriptor instead. func (*SetReplicationSourceRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{84} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{85} } func (x *SetReplicationSourceRequest) GetParent() *topodata.TabletAlias { @@ -4228,7 +4501,7 @@ type SetReplicationSourceResponse struct { func (x *SetReplicationSourceResponse) Reset() { *x = SetReplicationSourceResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[85] + mi := &file_tabletmanagerdata_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4241,7 +4514,7 @@ func (x *SetReplicationSourceResponse) String() string { func (*SetReplicationSourceResponse) ProtoMessage() {} func (x *SetReplicationSourceResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[85] + mi := &file_tabletmanagerdata_proto_msgTypes[86] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4254,7 +4527,7 @@ func (x *SetReplicationSourceResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetReplicationSourceResponse.ProtoReflect.Descriptor instead. func (*SetReplicationSourceResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{85} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{86} } type ReplicaWasRestartedRequest struct { @@ -4269,7 +4542,7 @@ type ReplicaWasRestartedRequest struct { func (x *ReplicaWasRestartedRequest) Reset() { *x = ReplicaWasRestartedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[86] + mi := &file_tabletmanagerdata_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4282,7 +4555,7 @@ func (x *ReplicaWasRestartedRequest) String() string { func (*ReplicaWasRestartedRequest) ProtoMessage() {} func (x *ReplicaWasRestartedRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[86] + mi := &file_tabletmanagerdata_proto_msgTypes[87] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4295,7 +4568,7 @@ func (x *ReplicaWasRestartedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplicaWasRestartedRequest.ProtoReflect.Descriptor instead. func (*ReplicaWasRestartedRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{86} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{87} } func (x *ReplicaWasRestartedRequest) GetParent() *topodata.TabletAlias { @@ -4314,7 +4587,7 @@ type ReplicaWasRestartedResponse struct { func (x *ReplicaWasRestartedResponse) Reset() { *x = ReplicaWasRestartedResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[87] + mi := &file_tabletmanagerdata_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4327,7 +4600,7 @@ func (x *ReplicaWasRestartedResponse) String() string { func (*ReplicaWasRestartedResponse) ProtoMessage() {} func (x *ReplicaWasRestartedResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[87] + mi := &file_tabletmanagerdata_proto_msgTypes[88] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4340,7 +4613,7 @@ func (x *ReplicaWasRestartedResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReplicaWasRestartedResponse.ProtoReflect.Descriptor instead. func (*ReplicaWasRestartedResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{87} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{88} } type StopReplicationAndGetStatusRequest struct { @@ -4354,7 +4627,7 @@ type StopReplicationAndGetStatusRequest struct { func (x *StopReplicationAndGetStatusRequest) Reset() { *x = StopReplicationAndGetStatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[88] + mi := &file_tabletmanagerdata_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4367,7 +4640,7 @@ func (x *StopReplicationAndGetStatusRequest) String() string { func (*StopReplicationAndGetStatusRequest) ProtoMessage() {} func (x *StopReplicationAndGetStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[88] + mi := &file_tabletmanagerdata_proto_msgTypes[89] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4380,7 +4653,7 @@ func (x *StopReplicationAndGetStatusRequest) ProtoReflect() protoreflect.Message // Deprecated: Use StopReplicationAndGetStatusRequest.ProtoReflect.Descriptor instead. func (*StopReplicationAndGetStatusRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{88} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{89} } func (x *StopReplicationAndGetStatusRequest) GetStopReplicationMode() replicationdata.StopReplicationMode { @@ -4402,7 +4675,7 @@ type StopReplicationAndGetStatusResponse struct { func (x *StopReplicationAndGetStatusResponse) Reset() { *x = StopReplicationAndGetStatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[89] + mi := &file_tabletmanagerdata_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4415,7 +4688,7 @@ func (x *StopReplicationAndGetStatusResponse) String() string { func (*StopReplicationAndGetStatusResponse) ProtoMessage() {} func (x *StopReplicationAndGetStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[89] + mi := &file_tabletmanagerdata_proto_msgTypes[90] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4428,7 +4701,7 @@ func (x *StopReplicationAndGetStatusResponse) ProtoReflect() protoreflect.Messag // Deprecated: Use StopReplicationAndGetStatusResponse.ProtoReflect.Descriptor instead. func (*StopReplicationAndGetStatusResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{89} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{90} } func (x *StopReplicationAndGetStatusResponse) GetStatus() *replicationdata.StopReplicationStatus { @@ -4449,7 +4722,7 @@ type PromoteReplicaRequest struct { func (x *PromoteReplicaRequest) Reset() { *x = PromoteReplicaRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[90] + mi := &file_tabletmanagerdata_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4462,7 +4735,7 @@ func (x *PromoteReplicaRequest) String() string { func (*PromoteReplicaRequest) ProtoMessage() {} func (x *PromoteReplicaRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[90] + mi := &file_tabletmanagerdata_proto_msgTypes[91] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4475,7 +4748,7 @@ func (x *PromoteReplicaRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PromoteReplicaRequest.ProtoReflect.Descriptor instead. func (*PromoteReplicaRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{90} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{91} } func (x *PromoteReplicaRequest) GetSemiSync() bool { @@ -4496,7 +4769,7 @@ type PromoteReplicaResponse struct { func (x *PromoteReplicaResponse) Reset() { *x = PromoteReplicaResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[91] + mi := &file_tabletmanagerdata_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4509,7 +4782,7 @@ func (x *PromoteReplicaResponse) String() string { func (*PromoteReplicaResponse) ProtoMessage() {} func (x *PromoteReplicaResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[91] + mi := &file_tabletmanagerdata_proto_msgTypes[92] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4522,7 +4795,7 @@ func (x *PromoteReplicaResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PromoteReplicaResponse.ProtoReflect.Descriptor instead. func (*PromoteReplicaResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{91} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{92} } func (x *PromoteReplicaResponse) GetPosition() string { @@ -4550,7 +4823,7 @@ type BackupRequest struct { func (x *BackupRequest) Reset() { *x = BackupRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[92] + mi := &file_tabletmanagerdata_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4563,7 +4836,7 @@ func (x *BackupRequest) String() string { func (*BackupRequest) ProtoMessage() {} func (x *BackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[92] + mi := &file_tabletmanagerdata_proto_msgTypes[93] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4576,7 +4849,7 @@ func (x *BackupRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BackupRequest.ProtoReflect.Descriptor instead. func (*BackupRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{92} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{93} } func (x *BackupRequest) GetConcurrency() int64 { @@ -4618,7 +4891,7 @@ type BackupResponse struct { func (x *BackupResponse) Reset() { *x = BackupResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[93] + mi := &file_tabletmanagerdata_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4631,7 +4904,7 @@ func (x *BackupResponse) String() string { func (*BackupResponse) ProtoMessage() {} func (x *BackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[93] + mi := &file_tabletmanagerdata_proto_msgTypes[94] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4644,7 +4917,7 @@ func (x *BackupResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BackupResponse.ProtoReflect.Descriptor instead. func (*BackupResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{93} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{94} } func (x *BackupResponse) GetEvent() *logutil.Event { @@ -4674,7 +4947,7 @@ type RestoreFromBackupRequest struct { func (x *RestoreFromBackupRequest) Reset() { *x = RestoreFromBackupRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[94] + mi := &file_tabletmanagerdata_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4687,7 +4960,7 @@ func (x *RestoreFromBackupRequest) String() string { func (*RestoreFromBackupRequest) ProtoMessage() {} func (x *RestoreFromBackupRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[94] + mi := &file_tabletmanagerdata_proto_msgTypes[95] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4700,7 +4973,7 @@ func (x *RestoreFromBackupRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RestoreFromBackupRequest.ProtoReflect.Descriptor instead. func (*RestoreFromBackupRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{94} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{95} } func (x *RestoreFromBackupRequest) GetBackupTime() *vttime.Time { @@ -4742,7 +5015,7 @@ type RestoreFromBackupResponse struct { func (x *RestoreFromBackupResponse) Reset() { *x = RestoreFromBackupResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[95] + mi := &file_tabletmanagerdata_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4755,7 +5028,7 @@ func (x *RestoreFromBackupResponse) String() string { func (*RestoreFromBackupResponse) ProtoMessage() {} func (x *RestoreFromBackupResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[95] + mi := &file_tabletmanagerdata_proto_msgTypes[96] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4768,7 +5041,7 @@ func (x *RestoreFromBackupResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RestoreFromBackupResponse.ProtoReflect.Descriptor instead. func (*RestoreFromBackupResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{95} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{96} } func (x *RestoreFromBackupResponse) GetEvent() *logutil.Event { @@ -4804,7 +5077,7 @@ type CreateVReplicationWorkflowRequest struct { func (x *CreateVReplicationWorkflowRequest) Reset() { *x = CreateVReplicationWorkflowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[96] + mi := &file_tabletmanagerdata_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4817,7 +5090,7 @@ func (x *CreateVReplicationWorkflowRequest) String() string { func (*CreateVReplicationWorkflowRequest) ProtoMessage() {} func (x *CreateVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[96] + mi := &file_tabletmanagerdata_proto_msgTypes[97] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4830,7 +5103,7 @@ func (x *CreateVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message // Deprecated: Use CreateVReplicationWorkflowRequest.ProtoReflect.Descriptor instead. func (*CreateVReplicationWorkflowRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{96} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{97} } func (x *CreateVReplicationWorkflowRequest) GetWorkflow() string { @@ -4914,7 +5187,7 @@ type CreateVReplicationWorkflowResponse struct { func (x *CreateVReplicationWorkflowResponse) Reset() { *x = CreateVReplicationWorkflowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[97] + mi := &file_tabletmanagerdata_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4927,7 +5200,7 @@ func (x *CreateVReplicationWorkflowResponse) String() string { func (*CreateVReplicationWorkflowResponse) ProtoMessage() {} func (x *CreateVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[97] + mi := &file_tabletmanagerdata_proto_msgTypes[98] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4940,7 +5213,7 @@ func (x *CreateVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message // Deprecated: Use CreateVReplicationWorkflowResponse.ProtoReflect.Descriptor instead. func (*CreateVReplicationWorkflowResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{97} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{98} } func (x *CreateVReplicationWorkflowResponse) GetResult() *query.QueryResult { @@ -4961,7 +5234,7 @@ type DeleteVReplicationWorkflowRequest struct { func (x *DeleteVReplicationWorkflowRequest) Reset() { *x = DeleteVReplicationWorkflowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[98] + mi := &file_tabletmanagerdata_proto_msgTypes[99] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -4974,7 +5247,7 @@ func (x *DeleteVReplicationWorkflowRequest) String() string { func (*DeleteVReplicationWorkflowRequest) ProtoMessage() {} func (x *DeleteVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[98] + mi := &file_tabletmanagerdata_proto_msgTypes[99] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4987,7 +5260,7 @@ func (x *DeleteVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message // Deprecated: Use DeleteVReplicationWorkflowRequest.ProtoReflect.Descriptor instead. func (*DeleteVReplicationWorkflowRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{98} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{99} } func (x *DeleteVReplicationWorkflowRequest) GetWorkflow() string { @@ -5008,7 +5281,7 @@ type DeleteVReplicationWorkflowResponse struct { func (x *DeleteVReplicationWorkflowResponse) Reset() { *x = DeleteVReplicationWorkflowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[99] + mi := &file_tabletmanagerdata_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5021,7 +5294,7 @@ func (x *DeleteVReplicationWorkflowResponse) String() string { func (*DeleteVReplicationWorkflowResponse) ProtoMessage() {} func (x *DeleteVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[99] + mi := &file_tabletmanagerdata_proto_msgTypes[100] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5034,7 +5307,7 @@ func (x *DeleteVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message // Deprecated: Use DeleteVReplicationWorkflowResponse.ProtoReflect.Descriptor instead. func (*DeleteVReplicationWorkflowResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{99} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{100} } func (x *DeleteVReplicationWorkflowResponse) GetResult() *query.QueryResult { @@ -5055,7 +5328,7 @@ type ReadVReplicationWorkflowRequest struct { func (x *ReadVReplicationWorkflowRequest) Reset() { *x = ReadVReplicationWorkflowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[100] + mi := &file_tabletmanagerdata_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5068,7 +5341,7 @@ func (x *ReadVReplicationWorkflowRequest) String() string { func (*ReadVReplicationWorkflowRequest) ProtoMessage() {} func (x *ReadVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[100] + mi := &file_tabletmanagerdata_proto_msgTypes[101] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5081,7 +5354,7 @@ func (x *ReadVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadVReplicationWorkflowRequest.ProtoReflect.Descriptor instead. func (*ReadVReplicationWorkflowRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{100} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{101} } func (x *ReadVReplicationWorkflowRequest) GetWorkflow() string { @@ -5111,7 +5384,7 @@ type ReadVReplicationWorkflowResponse struct { func (x *ReadVReplicationWorkflowResponse) Reset() { *x = ReadVReplicationWorkflowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[101] + mi := &file_tabletmanagerdata_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5124,7 +5397,7 @@ func (x *ReadVReplicationWorkflowResponse) String() string { func (*ReadVReplicationWorkflowResponse) ProtoMessage() {} func (x *ReadVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[101] + mi := &file_tabletmanagerdata_proto_msgTypes[102] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5137,7 +5410,7 @@ func (x *ReadVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ReadVReplicationWorkflowResponse.ProtoReflect.Descriptor instead. func (*ReadVReplicationWorkflowResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{101} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{102} } func (x *ReadVReplicationWorkflowResponse) GetWorkflow() string { @@ -5226,7 +5499,7 @@ type VDiffRequest struct { func (x *VDiffRequest) Reset() { *x = VDiffRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[102] + mi := &file_tabletmanagerdata_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5239,7 +5512,7 @@ func (x *VDiffRequest) String() string { func (*VDiffRequest) ProtoMessage() {} func (x *VDiffRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[102] + mi := &file_tabletmanagerdata_proto_msgTypes[103] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5252,7 +5525,7 @@ func (x *VDiffRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffRequest.ProtoReflect.Descriptor instead. func (*VDiffRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{102} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{103} } func (x *VDiffRequest) GetKeyspace() string { @@ -5310,7 +5583,7 @@ type VDiffResponse struct { func (x *VDiffResponse) Reset() { *x = VDiffResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[103] + mi := &file_tabletmanagerdata_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5323,7 +5596,7 @@ func (x *VDiffResponse) String() string { func (*VDiffResponse) ProtoMessage() {} func (x *VDiffResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[103] + mi := &file_tabletmanagerdata_proto_msgTypes[104] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5336,7 +5609,7 @@ func (x *VDiffResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffResponse.ProtoReflect.Descriptor instead. func (*VDiffResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{103} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{104} } func (x *VDiffResponse) GetId() int64 { @@ -5374,7 +5647,7 @@ type VDiffPickerOptions struct { func (x *VDiffPickerOptions) Reset() { *x = VDiffPickerOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[104] + mi := &file_tabletmanagerdata_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5387,7 +5660,7 @@ func (x *VDiffPickerOptions) String() string { func (*VDiffPickerOptions) ProtoMessage() {} func (x *VDiffPickerOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[104] + mi := &file_tabletmanagerdata_proto_msgTypes[105] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5400,7 +5673,7 @@ func (x *VDiffPickerOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffPickerOptions.ProtoReflect.Descriptor instead. func (*VDiffPickerOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{104} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{105} } func (x *VDiffPickerOptions) GetTabletTypes() string { @@ -5438,7 +5711,7 @@ type VDiffReportOptions struct { func (x *VDiffReportOptions) Reset() { *x = VDiffReportOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[105] + mi := &file_tabletmanagerdata_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5451,7 +5724,7 @@ func (x *VDiffReportOptions) String() string { func (*VDiffReportOptions) ProtoMessage() {} func (x *VDiffReportOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[105] + mi := &file_tabletmanagerdata_proto_msgTypes[106] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5464,7 +5737,7 @@ func (x *VDiffReportOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffReportOptions.ProtoReflect.Descriptor instead. func (*VDiffReportOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{105} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{106} } func (x *VDiffReportOptions) GetOnlyPks() bool { @@ -5506,7 +5779,7 @@ type VDiffCoreOptions struct { func (x *VDiffCoreOptions) Reset() { *x = VDiffCoreOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[106] + mi := &file_tabletmanagerdata_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5519,7 +5792,7 @@ func (x *VDiffCoreOptions) String() string { func (*VDiffCoreOptions) ProtoMessage() {} func (x *VDiffCoreOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[106] + mi := &file_tabletmanagerdata_proto_msgTypes[107] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5532,7 +5805,7 @@ func (x *VDiffCoreOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffCoreOptions.ProtoReflect.Descriptor instead. func (*VDiffCoreOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{106} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{107} } func (x *VDiffCoreOptions) GetTables() string { @@ -5604,7 +5877,7 @@ type VDiffOptions struct { func (x *VDiffOptions) Reset() { *x = VDiffOptions{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[107] + mi := &file_tabletmanagerdata_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5617,7 +5890,7 @@ func (x *VDiffOptions) String() string { func (*VDiffOptions) ProtoMessage() {} func (x *VDiffOptions) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[107] + mi := &file_tabletmanagerdata_proto_msgTypes[108] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5630,7 +5903,7 @@ func (x *VDiffOptions) ProtoReflect() protoreflect.Message { // Deprecated: Use VDiffOptions.ProtoReflect.Descriptor instead. func (*VDiffOptions) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{107} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{108} } func (x *VDiffOptions) GetPickerOptions() *VDiffPickerOptions { @@ -5670,7 +5943,7 @@ type UpdateVReplicationWorkflowRequest struct { func (x *UpdateVReplicationWorkflowRequest) Reset() { *x = UpdateVReplicationWorkflowRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[108] + mi := &file_tabletmanagerdata_proto_msgTypes[109] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5683,7 +5956,7 @@ func (x *UpdateVReplicationWorkflowRequest) String() string { func (*UpdateVReplicationWorkflowRequest) ProtoMessage() {} func (x *UpdateVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[108] + mi := &file_tabletmanagerdata_proto_msgTypes[109] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5696,7 +5969,7 @@ func (x *UpdateVReplicationWorkflowRequest) ProtoReflect() protoreflect.Message // Deprecated: Use UpdateVReplicationWorkflowRequest.ProtoReflect.Descriptor instead. func (*UpdateVReplicationWorkflowRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{108} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{109} } func (x *UpdateVReplicationWorkflowRequest) GetWorkflow() string { @@ -5752,7 +6025,7 @@ type UpdateVReplicationWorkflowResponse struct { func (x *UpdateVReplicationWorkflowResponse) Reset() { *x = UpdateVReplicationWorkflowResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[109] + mi := &file_tabletmanagerdata_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5765,7 +6038,7 @@ func (x *UpdateVReplicationWorkflowResponse) String() string { func (*UpdateVReplicationWorkflowResponse) ProtoMessage() {} func (x *UpdateVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[109] + mi := &file_tabletmanagerdata_proto_msgTypes[110] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5778,7 +6051,7 @@ func (x *UpdateVReplicationWorkflowResponse) ProtoReflect() protoreflect.Message // Deprecated: Use UpdateVReplicationWorkflowResponse.ProtoReflect.Descriptor instead. func (*UpdateVReplicationWorkflowResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{109} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{110} } func (x *UpdateVReplicationWorkflowResponse) GetResult() *query.QueryResult { @@ -5799,7 +6072,7 @@ type ResetSequencesRequest struct { func (x *ResetSequencesRequest) Reset() { *x = ResetSequencesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[110] + mi := &file_tabletmanagerdata_proto_msgTypes[111] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5812,7 +6085,7 @@ func (x *ResetSequencesRequest) String() string { func (*ResetSequencesRequest) ProtoMessage() {} func (x *ResetSequencesRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[110] + mi := &file_tabletmanagerdata_proto_msgTypes[111] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5825,7 +6098,7 @@ func (x *ResetSequencesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSequencesRequest.ProtoReflect.Descriptor instead. func (*ResetSequencesRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{110} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{111} } func (x *ResetSequencesRequest) GetTables() []string { @@ -5844,7 +6117,7 @@ type ResetSequencesResponse struct { func (x *ResetSequencesResponse) Reset() { *x = ResetSequencesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[111] + mi := &file_tabletmanagerdata_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5857,7 +6130,7 @@ func (x *ResetSequencesResponse) String() string { func (*ResetSequencesResponse) ProtoMessage() {} func (x *ResetSequencesResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[111] + mi := &file_tabletmanagerdata_proto_msgTypes[112] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5870,7 +6143,7 @@ func (x *ResetSequencesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ResetSequencesResponse.ProtoReflect.Descriptor instead. func (*ResetSequencesResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{111} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{112} } type CheckThrottlerRequest struct { @@ -5884,7 +6157,7 @@ type CheckThrottlerRequest struct { func (x *CheckThrottlerRequest) Reset() { *x = CheckThrottlerRequest{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[112] + mi := &file_tabletmanagerdata_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5897,7 +6170,7 @@ func (x *CheckThrottlerRequest) String() string { func (*CheckThrottlerRequest) ProtoMessage() {} func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[112] + mi := &file_tabletmanagerdata_proto_msgTypes[113] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5910,7 +6183,7 @@ func (x *CheckThrottlerRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckThrottlerRequest.ProtoReflect.Descriptor instead. func (*CheckThrottlerRequest) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{112} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{113} } func (x *CheckThrottlerRequest) GetAppName() string { @@ -5943,7 +6216,7 @@ type CheckThrottlerResponse struct { func (x *CheckThrottlerResponse) Reset() { *x = CheckThrottlerResponse{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[113] + mi := &file_tabletmanagerdata_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5956,7 +6229,7 @@ func (x *CheckThrottlerResponse) String() string { func (*CheckThrottlerResponse) ProtoMessage() {} func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[113] + mi := &file_tabletmanagerdata_proto_msgTypes[114] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5969,7 +6242,7 @@ func (x *CheckThrottlerResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckThrottlerResponse.ProtoReflect.Descriptor instead. func (*CheckThrottlerResponse) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{113} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{114} } func (x *CheckThrottlerResponse) GetStatusCode() int32 { @@ -6038,7 +6311,7 @@ type ReadVReplicationWorkflowResponse_Stream struct { func (x *ReadVReplicationWorkflowResponse_Stream) Reset() { *x = ReadVReplicationWorkflowResponse_Stream{} if protoimpl.UnsafeEnabled { - mi := &file_tabletmanagerdata_proto_msgTypes[117] + mi := &file_tabletmanagerdata_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6051,7 +6324,7 @@ func (x *ReadVReplicationWorkflowResponse_Stream) String() string { func (*ReadVReplicationWorkflowResponse_Stream) ProtoMessage() {} func (x *ReadVReplicationWorkflowResponse_Stream) ProtoReflect() protoreflect.Message { - mi := &file_tabletmanagerdata_proto_msgTypes[117] + mi := &file_tabletmanagerdata_proto_msgTypes[118] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6064,7 +6337,7 @@ func (x *ReadVReplicationWorkflowResponse_Stream) ProtoReflect() protoreflect.Me // Deprecated: Use ReadVReplicationWorkflowResponse_Stream.ProtoReflect.Descriptor instead. func (*ReadVReplicationWorkflowResponse_Stream) Descriptor() ([]byte, []int) { - return file_tabletmanagerdata_proto_rawDescGZIP(), []int{101, 0} + return file_tabletmanagerdata_proto_rawDescGZIP(), []int{102, 0} } func (x *ReadVReplicationWorkflowResponse_Stream) GetId() int32 { @@ -6177,7 +6450,51 @@ var file_tabletmanagerdata_proto_rawDesc = []byte{ 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x6c, 0x6f, 0x67, 0x75, 0x74, 0x69, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0c, 0x76, 0x74, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x0b, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xff, 0x01, 0x0a, + 0x0b, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xbd, 0x05, 0x0a, + 0x09, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x44, 0x4c, 0x12, 0x1a, 0x0a, 0x08, 0x6b, 0x65, + 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6b, 0x65, + 0x79, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, + 0x68, 0x65, 0x6d, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x41, 0x0a, 0x08, 0x73, 0x74, + 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, + 0x2e, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, 0x44, 0x4c, 0x2e, 0x53, 0x74, 0x72, 0x61, 0x74, + 0x65, 0x67, 0x79, 0x52, 0x08, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x18, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x6d, 0x69, 0x67, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x08, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x10, 0x6d, 0x69, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x12, 0x3b, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x4f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x44, + 0x44, 0x4c, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, + 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, + 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, + 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x72, 0x65, + 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x72, 0x65, 0x61, 0x64, 0x79, 0x5f, 0x74, + 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x54, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x31, 0x0a, 0x15, 0x77, 0x61, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x79, 0x5f, 0x74, + 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x12, 0x77, 0x61, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x54, 0x6f, 0x43, 0x6f, 0x6d, 0x70, + 0x6c, 0x65, 0x74, 0x65, 0x22, 0x53, 0x0a, 0x08, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, + 0x12, 0x0a, 0x0a, 0x06, 0x56, 0x49, 0x54, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, + 0x4f, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x48, 0x4f, 0x53, + 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x54, 0x4f, 0x53, 0x43, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x59, + 0x53, 0x51, 0x4c, 0x10, 0x04, 0x1a, 0x02, 0x10, 0x01, 0x22, 0x71, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, + 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x51, 0x55, 0x45, 0x53, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, + 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x51, 0x55, 0x45, 0x55, 0x45, 0x44, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x52, 0x45, + 0x41, 0x44, 0x59, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x55, 0x4e, 0x4e, 0x49, 0x4e, 0x47, + 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x10, 0x06, + 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x07, 0x22, 0xff, 0x01, 0x0a, 0x0f, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x18, 0x02, @@ -6908,217 +7225,223 @@ func file_tabletmanagerdata_proto_rawDescGZIP() []byte { return file_tabletmanagerdata_proto_rawDescData } -var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 118) +var file_tabletmanagerdata_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_tabletmanagerdata_proto_msgTypes = make([]protoimpl.MessageInfo, 119) var file_tabletmanagerdata_proto_goTypes = []interface{}{ (TabletSelectionPreference)(0), // 0: tabletmanagerdata.TabletSelectionPreference - (*TableDefinition)(nil), // 1: tabletmanagerdata.TableDefinition - (*SchemaDefinition)(nil), // 2: tabletmanagerdata.SchemaDefinition - (*SchemaChangeResult)(nil), // 3: tabletmanagerdata.SchemaChangeResult - (*UserPermission)(nil), // 4: tabletmanagerdata.UserPermission - (*DbPermission)(nil), // 5: tabletmanagerdata.DbPermission - (*Permissions)(nil), // 6: tabletmanagerdata.Permissions - (*PingRequest)(nil), // 7: tabletmanagerdata.PingRequest - (*PingResponse)(nil), // 8: tabletmanagerdata.PingResponse - (*SleepRequest)(nil), // 9: tabletmanagerdata.SleepRequest - (*SleepResponse)(nil), // 10: tabletmanagerdata.SleepResponse - (*ExecuteHookRequest)(nil), // 11: tabletmanagerdata.ExecuteHookRequest - (*ExecuteHookResponse)(nil), // 12: tabletmanagerdata.ExecuteHookResponse - (*GetSchemaRequest)(nil), // 13: tabletmanagerdata.GetSchemaRequest - (*GetSchemaResponse)(nil), // 14: tabletmanagerdata.GetSchemaResponse - (*GetPermissionsRequest)(nil), // 15: tabletmanagerdata.GetPermissionsRequest - (*GetPermissionsResponse)(nil), // 16: tabletmanagerdata.GetPermissionsResponse - (*SetReadOnlyRequest)(nil), // 17: tabletmanagerdata.SetReadOnlyRequest - (*SetReadOnlyResponse)(nil), // 18: tabletmanagerdata.SetReadOnlyResponse - (*SetReadWriteRequest)(nil), // 19: tabletmanagerdata.SetReadWriteRequest - (*SetReadWriteResponse)(nil), // 20: tabletmanagerdata.SetReadWriteResponse - (*ChangeTypeRequest)(nil), // 21: tabletmanagerdata.ChangeTypeRequest - (*ChangeTypeResponse)(nil), // 22: tabletmanagerdata.ChangeTypeResponse - (*RefreshStateRequest)(nil), // 23: tabletmanagerdata.RefreshStateRequest - (*RefreshStateResponse)(nil), // 24: tabletmanagerdata.RefreshStateResponse - (*RunHealthCheckRequest)(nil), // 25: tabletmanagerdata.RunHealthCheckRequest - (*RunHealthCheckResponse)(nil), // 26: tabletmanagerdata.RunHealthCheckResponse - (*ReloadSchemaRequest)(nil), // 27: tabletmanagerdata.ReloadSchemaRequest - (*ReloadSchemaResponse)(nil), // 28: tabletmanagerdata.ReloadSchemaResponse - (*PreflightSchemaRequest)(nil), // 29: tabletmanagerdata.PreflightSchemaRequest - (*PreflightSchemaResponse)(nil), // 30: tabletmanagerdata.PreflightSchemaResponse - (*ApplySchemaRequest)(nil), // 31: tabletmanagerdata.ApplySchemaRequest - (*ApplySchemaResponse)(nil), // 32: tabletmanagerdata.ApplySchemaResponse - (*LockTablesRequest)(nil), // 33: tabletmanagerdata.LockTablesRequest - (*LockTablesResponse)(nil), // 34: tabletmanagerdata.LockTablesResponse - (*UnlockTablesRequest)(nil), // 35: tabletmanagerdata.UnlockTablesRequest - (*UnlockTablesResponse)(nil), // 36: tabletmanagerdata.UnlockTablesResponse - (*ExecuteQueryRequest)(nil), // 37: tabletmanagerdata.ExecuteQueryRequest - (*ExecuteQueryResponse)(nil), // 38: tabletmanagerdata.ExecuteQueryResponse - (*ExecuteFetchAsDbaRequest)(nil), // 39: tabletmanagerdata.ExecuteFetchAsDbaRequest - (*ExecuteFetchAsDbaResponse)(nil), // 40: tabletmanagerdata.ExecuteFetchAsDbaResponse - (*ExecuteFetchAsAllPrivsRequest)(nil), // 41: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest - (*ExecuteFetchAsAllPrivsResponse)(nil), // 42: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse - (*ExecuteFetchAsAppRequest)(nil), // 43: tabletmanagerdata.ExecuteFetchAsAppRequest - (*ExecuteFetchAsAppResponse)(nil), // 44: tabletmanagerdata.ExecuteFetchAsAppResponse - (*ReplicationStatusRequest)(nil), // 45: tabletmanagerdata.ReplicationStatusRequest - (*ReplicationStatusResponse)(nil), // 46: tabletmanagerdata.ReplicationStatusResponse - (*PrimaryStatusRequest)(nil), // 47: tabletmanagerdata.PrimaryStatusRequest - (*PrimaryStatusResponse)(nil), // 48: tabletmanagerdata.PrimaryStatusResponse - (*PrimaryPositionRequest)(nil), // 49: tabletmanagerdata.PrimaryPositionRequest - (*PrimaryPositionResponse)(nil), // 50: tabletmanagerdata.PrimaryPositionResponse - (*WaitForPositionRequest)(nil), // 51: tabletmanagerdata.WaitForPositionRequest - (*WaitForPositionResponse)(nil), // 52: tabletmanagerdata.WaitForPositionResponse - (*StopReplicationRequest)(nil), // 53: tabletmanagerdata.StopReplicationRequest - (*StopReplicationResponse)(nil), // 54: tabletmanagerdata.StopReplicationResponse - (*StopReplicationMinimumRequest)(nil), // 55: tabletmanagerdata.StopReplicationMinimumRequest - (*StopReplicationMinimumResponse)(nil), // 56: tabletmanagerdata.StopReplicationMinimumResponse - (*StartReplicationRequest)(nil), // 57: tabletmanagerdata.StartReplicationRequest - (*StartReplicationResponse)(nil), // 58: tabletmanagerdata.StartReplicationResponse - (*StartReplicationUntilAfterRequest)(nil), // 59: tabletmanagerdata.StartReplicationUntilAfterRequest - (*StartReplicationUntilAfterResponse)(nil), // 60: tabletmanagerdata.StartReplicationUntilAfterResponse - (*GetReplicasRequest)(nil), // 61: tabletmanagerdata.GetReplicasRequest - (*GetReplicasResponse)(nil), // 62: tabletmanagerdata.GetReplicasResponse - (*ResetReplicationRequest)(nil), // 63: tabletmanagerdata.ResetReplicationRequest - (*ResetReplicationResponse)(nil), // 64: tabletmanagerdata.ResetReplicationResponse - (*VReplicationExecRequest)(nil), // 65: tabletmanagerdata.VReplicationExecRequest - (*VReplicationExecResponse)(nil), // 66: tabletmanagerdata.VReplicationExecResponse - (*VReplicationWaitForPosRequest)(nil), // 67: tabletmanagerdata.VReplicationWaitForPosRequest - (*VReplicationWaitForPosResponse)(nil), // 68: tabletmanagerdata.VReplicationWaitForPosResponse - (*InitPrimaryRequest)(nil), // 69: tabletmanagerdata.InitPrimaryRequest - (*InitPrimaryResponse)(nil), // 70: tabletmanagerdata.InitPrimaryResponse - (*PopulateReparentJournalRequest)(nil), // 71: tabletmanagerdata.PopulateReparentJournalRequest - (*PopulateReparentJournalResponse)(nil), // 72: tabletmanagerdata.PopulateReparentJournalResponse - (*InitReplicaRequest)(nil), // 73: tabletmanagerdata.InitReplicaRequest - (*InitReplicaResponse)(nil), // 74: tabletmanagerdata.InitReplicaResponse - (*DemotePrimaryRequest)(nil), // 75: tabletmanagerdata.DemotePrimaryRequest - (*DemotePrimaryResponse)(nil), // 76: tabletmanagerdata.DemotePrimaryResponse - (*UndoDemotePrimaryRequest)(nil), // 77: tabletmanagerdata.UndoDemotePrimaryRequest - (*UndoDemotePrimaryResponse)(nil), // 78: tabletmanagerdata.UndoDemotePrimaryResponse - (*ReplicaWasPromotedRequest)(nil), // 79: tabletmanagerdata.ReplicaWasPromotedRequest - (*ReplicaWasPromotedResponse)(nil), // 80: tabletmanagerdata.ReplicaWasPromotedResponse - (*ResetReplicationParametersRequest)(nil), // 81: tabletmanagerdata.ResetReplicationParametersRequest - (*ResetReplicationParametersResponse)(nil), // 82: tabletmanagerdata.ResetReplicationParametersResponse - (*FullStatusRequest)(nil), // 83: tabletmanagerdata.FullStatusRequest - (*FullStatusResponse)(nil), // 84: tabletmanagerdata.FullStatusResponse - (*SetReplicationSourceRequest)(nil), // 85: tabletmanagerdata.SetReplicationSourceRequest - (*SetReplicationSourceResponse)(nil), // 86: tabletmanagerdata.SetReplicationSourceResponse - (*ReplicaWasRestartedRequest)(nil), // 87: tabletmanagerdata.ReplicaWasRestartedRequest - (*ReplicaWasRestartedResponse)(nil), // 88: tabletmanagerdata.ReplicaWasRestartedResponse - (*StopReplicationAndGetStatusRequest)(nil), // 89: tabletmanagerdata.StopReplicationAndGetStatusRequest - (*StopReplicationAndGetStatusResponse)(nil), // 90: tabletmanagerdata.StopReplicationAndGetStatusResponse - (*PromoteReplicaRequest)(nil), // 91: tabletmanagerdata.PromoteReplicaRequest - (*PromoteReplicaResponse)(nil), // 92: tabletmanagerdata.PromoteReplicaResponse - (*BackupRequest)(nil), // 93: tabletmanagerdata.BackupRequest - (*BackupResponse)(nil), // 94: tabletmanagerdata.BackupResponse - (*RestoreFromBackupRequest)(nil), // 95: tabletmanagerdata.RestoreFromBackupRequest - (*RestoreFromBackupResponse)(nil), // 96: tabletmanagerdata.RestoreFromBackupResponse - (*CreateVReplicationWorkflowRequest)(nil), // 97: tabletmanagerdata.CreateVReplicationWorkflowRequest - (*CreateVReplicationWorkflowResponse)(nil), // 98: tabletmanagerdata.CreateVReplicationWorkflowResponse - (*DeleteVReplicationWorkflowRequest)(nil), // 99: tabletmanagerdata.DeleteVReplicationWorkflowRequest - (*DeleteVReplicationWorkflowResponse)(nil), // 100: tabletmanagerdata.DeleteVReplicationWorkflowResponse - (*ReadVReplicationWorkflowRequest)(nil), // 101: tabletmanagerdata.ReadVReplicationWorkflowRequest - (*ReadVReplicationWorkflowResponse)(nil), // 102: tabletmanagerdata.ReadVReplicationWorkflowResponse - (*VDiffRequest)(nil), // 103: tabletmanagerdata.VDiffRequest - (*VDiffResponse)(nil), // 104: tabletmanagerdata.VDiffResponse - (*VDiffPickerOptions)(nil), // 105: tabletmanagerdata.VDiffPickerOptions - (*VDiffReportOptions)(nil), // 106: tabletmanagerdata.VDiffReportOptions - (*VDiffCoreOptions)(nil), // 107: tabletmanagerdata.VDiffCoreOptions - (*VDiffOptions)(nil), // 108: tabletmanagerdata.VDiffOptions - (*UpdateVReplicationWorkflowRequest)(nil), // 109: tabletmanagerdata.UpdateVReplicationWorkflowRequest - (*UpdateVReplicationWorkflowResponse)(nil), // 110: tabletmanagerdata.UpdateVReplicationWorkflowResponse - (*ResetSequencesRequest)(nil), // 111: tabletmanagerdata.ResetSequencesRequest - (*ResetSequencesResponse)(nil), // 112: tabletmanagerdata.ResetSequencesResponse - (*CheckThrottlerRequest)(nil), // 113: tabletmanagerdata.CheckThrottlerRequest - (*CheckThrottlerResponse)(nil), // 114: tabletmanagerdata.CheckThrottlerResponse - nil, // 115: tabletmanagerdata.UserPermission.PrivilegesEntry - nil, // 116: tabletmanagerdata.DbPermission.PrivilegesEntry - nil, // 117: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - (*ReadVReplicationWorkflowResponse_Stream)(nil), // 118: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - (*query.Field)(nil), // 119: query.Field - (topodata.TabletType)(0), // 120: topodata.TabletType - (*vtrpc.CallerID)(nil), // 121: vtrpc.CallerID - (*query.QueryResult)(nil), // 122: query.QueryResult - (*replicationdata.Status)(nil), // 123: replicationdata.Status - (*replicationdata.PrimaryStatus)(nil), // 124: replicationdata.PrimaryStatus - (*topodata.TabletAlias)(nil), // 125: topodata.TabletAlias - (*replicationdata.FullStatus)(nil), // 126: replicationdata.FullStatus - (replicationdata.StopReplicationMode)(0), // 127: replicationdata.StopReplicationMode - (*replicationdata.StopReplicationStatus)(nil), // 128: replicationdata.StopReplicationStatus - (*logutil.Event)(nil), // 129: logutil.Event - (*vttime.Time)(nil), // 130: vttime.Time - (*binlogdata.BinlogSource)(nil), // 131: binlogdata.BinlogSource - (binlogdata.VReplicationWorkflowType)(0), // 132: binlogdata.VReplicationWorkflowType - (binlogdata.VReplicationWorkflowSubType)(0), // 133: binlogdata.VReplicationWorkflowSubType - (binlogdata.OnDDLAction)(0), // 134: binlogdata.OnDDLAction - (binlogdata.VReplicationWorkflowState)(0), // 135: binlogdata.VReplicationWorkflowState + (OnlineDDL_Strategy)(0), // 1: tabletmanagerdata.OnlineDDL.Strategy + (OnlineDDL_Status)(0), // 2: tabletmanagerdata.OnlineDDL.Status + (*OnlineDDL)(nil), // 3: tabletmanagerdata.OnlineDDL + (*TableDefinition)(nil), // 4: tabletmanagerdata.TableDefinition + (*SchemaDefinition)(nil), // 5: tabletmanagerdata.SchemaDefinition + (*SchemaChangeResult)(nil), // 6: tabletmanagerdata.SchemaChangeResult + (*UserPermission)(nil), // 7: tabletmanagerdata.UserPermission + (*DbPermission)(nil), // 8: tabletmanagerdata.DbPermission + (*Permissions)(nil), // 9: tabletmanagerdata.Permissions + (*PingRequest)(nil), // 10: tabletmanagerdata.PingRequest + (*PingResponse)(nil), // 11: tabletmanagerdata.PingResponse + (*SleepRequest)(nil), // 12: tabletmanagerdata.SleepRequest + (*SleepResponse)(nil), // 13: tabletmanagerdata.SleepResponse + (*ExecuteHookRequest)(nil), // 14: tabletmanagerdata.ExecuteHookRequest + (*ExecuteHookResponse)(nil), // 15: tabletmanagerdata.ExecuteHookResponse + (*GetSchemaRequest)(nil), // 16: tabletmanagerdata.GetSchemaRequest + (*GetSchemaResponse)(nil), // 17: tabletmanagerdata.GetSchemaResponse + (*GetPermissionsRequest)(nil), // 18: tabletmanagerdata.GetPermissionsRequest + (*GetPermissionsResponse)(nil), // 19: tabletmanagerdata.GetPermissionsResponse + (*SetReadOnlyRequest)(nil), // 20: tabletmanagerdata.SetReadOnlyRequest + (*SetReadOnlyResponse)(nil), // 21: tabletmanagerdata.SetReadOnlyResponse + (*SetReadWriteRequest)(nil), // 22: tabletmanagerdata.SetReadWriteRequest + (*SetReadWriteResponse)(nil), // 23: tabletmanagerdata.SetReadWriteResponse + (*ChangeTypeRequest)(nil), // 24: tabletmanagerdata.ChangeTypeRequest + (*ChangeTypeResponse)(nil), // 25: tabletmanagerdata.ChangeTypeResponse + (*RefreshStateRequest)(nil), // 26: tabletmanagerdata.RefreshStateRequest + (*RefreshStateResponse)(nil), // 27: tabletmanagerdata.RefreshStateResponse + (*RunHealthCheckRequest)(nil), // 28: tabletmanagerdata.RunHealthCheckRequest + (*RunHealthCheckResponse)(nil), // 29: tabletmanagerdata.RunHealthCheckResponse + (*ReloadSchemaRequest)(nil), // 30: tabletmanagerdata.ReloadSchemaRequest + (*ReloadSchemaResponse)(nil), // 31: tabletmanagerdata.ReloadSchemaResponse + (*PreflightSchemaRequest)(nil), // 32: tabletmanagerdata.PreflightSchemaRequest + (*PreflightSchemaResponse)(nil), // 33: tabletmanagerdata.PreflightSchemaResponse + (*ApplySchemaRequest)(nil), // 34: tabletmanagerdata.ApplySchemaRequest + (*ApplySchemaResponse)(nil), // 35: tabletmanagerdata.ApplySchemaResponse + (*LockTablesRequest)(nil), // 36: tabletmanagerdata.LockTablesRequest + (*LockTablesResponse)(nil), // 37: tabletmanagerdata.LockTablesResponse + (*UnlockTablesRequest)(nil), // 38: tabletmanagerdata.UnlockTablesRequest + (*UnlockTablesResponse)(nil), // 39: tabletmanagerdata.UnlockTablesResponse + (*ExecuteQueryRequest)(nil), // 40: tabletmanagerdata.ExecuteQueryRequest + (*ExecuteQueryResponse)(nil), // 41: tabletmanagerdata.ExecuteQueryResponse + (*ExecuteFetchAsDbaRequest)(nil), // 42: tabletmanagerdata.ExecuteFetchAsDbaRequest + (*ExecuteFetchAsDbaResponse)(nil), // 43: tabletmanagerdata.ExecuteFetchAsDbaResponse + (*ExecuteFetchAsAllPrivsRequest)(nil), // 44: tabletmanagerdata.ExecuteFetchAsAllPrivsRequest + (*ExecuteFetchAsAllPrivsResponse)(nil), // 45: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse + (*ExecuteFetchAsAppRequest)(nil), // 46: tabletmanagerdata.ExecuteFetchAsAppRequest + (*ExecuteFetchAsAppResponse)(nil), // 47: tabletmanagerdata.ExecuteFetchAsAppResponse + (*ReplicationStatusRequest)(nil), // 48: tabletmanagerdata.ReplicationStatusRequest + (*ReplicationStatusResponse)(nil), // 49: tabletmanagerdata.ReplicationStatusResponse + (*PrimaryStatusRequest)(nil), // 50: tabletmanagerdata.PrimaryStatusRequest + (*PrimaryStatusResponse)(nil), // 51: tabletmanagerdata.PrimaryStatusResponse + (*PrimaryPositionRequest)(nil), // 52: tabletmanagerdata.PrimaryPositionRequest + (*PrimaryPositionResponse)(nil), // 53: tabletmanagerdata.PrimaryPositionResponse + (*WaitForPositionRequest)(nil), // 54: tabletmanagerdata.WaitForPositionRequest + (*WaitForPositionResponse)(nil), // 55: tabletmanagerdata.WaitForPositionResponse + (*StopReplicationRequest)(nil), // 56: tabletmanagerdata.StopReplicationRequest + (*StopReplicationResponse)(nil), // 57: tabletmanagerdata.StopReplicationResponse + (*StopReplicationMinimumRequest)(nil), // 58: tabletmanagerdata.StopReplicationMinimumRequest + (*StopReplicationMinimumResponse)(nil), // 59: tabletmanagerdata.StopReplicationMinimumResponse + (*StartReplicationRequest)(nil), // 60: tabletmanagerdata.StartReplicationRequest + (*StartReplicationResponse)(nil), // 61: tabletmanagerdata.StartReplicationResponse + (*StartReplicationUntilAfterRequest)(nil), // 62: tabletmanagerdata.StartReplicationUntilAfterRequest + (*StartReplicationUntilAfterResponse)(nil), // 63: tabletmanagerdata.StartReplicationUntilAfterResponse + (*GetReplicasRequest)(nil), // 64: tabletmanagerdata.GetReplicasRequest + (*GetReplicasResponse)(nil), // 65: tabletmanagerdata.GetReplicasResponse + (*ResetReplicationRequest)(nil), // 66: tabletmanagerdata.ResetReplicationRequest + (*ResetReplicationResponse)(nil), // 67: tabletmanagerdata.ResetReplicationResponse + (*VReplicationExecRequest)(nil), // 68: tabletmanagerdata.VReplicationExecRequest + (*VReplicationExecResponse)(nil), // 69: tabletmanagerdata.VReplicationExecResponse + (*VReplicationWaitForPosRequest)(nil), // 70: tabletmanagerdata.VReplicationWaitForPosRequest + (*VReplicationWaitForPosResponse)(nil), // 71: tabletmanagerdata.VReplicationWaitForPosResponse + (*InitPrimaryRequest)(nil), // 72: tabletmanagerdata.InitPrimaryRequest + (*InitPrimaryResponse)(nil), // 73: tabletmanagerdata.InitPrimaryResponse + (*PopulateReparentJournalRequest)(nil), // 74: tabletmanagerdata.PopulateReparentJournalRequest + (*PopulateReparentJournalResponse)(nil), // 75: tabletmanagerdata.PopulateReparentJournalResponse + (*InitReplicaRequest)(nil), // 76: tabletmanagerdata.InitReplicaRequest + (*InitReplicaResponse)(nil), // 77: tabletmanagerdata.InitReplicaResponse + (*DemotePrimaryRequest)(nil), // 78: tabletmanagerdata.DemotePrimaryRequest + (*DemotePrimaryResponse)(nil), // 79: tabletmanagerdata.DemotePrimaryResponse + (*UndoDemotePrimaryRequest)(nil), // 80: tabletmanagerdata.UndoDemotePrimaryRequest + (*UndoDemotePrimaryResponse)(nil), // 81: tabletmanagerdata.UndoDemotePrimaryResponse + (*ReplicaWasPromotedRequest)(nil), // 82: tabletmanagerdata.ReplicaWasPromotedRequest + (*ReplicaWasPromotedResponse)(nil), // 83: tabletmanagerdata.ReplicaWasPromotedResponse + (*ResetReplicationParametersRequest)(nil), // 84: tabletmanagerdata.ResetReplicationParametersRequest + (*ResetReplicationParametersResponse)(nil), // 85: tabletmanagerdata.ResetReplicationParametersResponse + (*FullStatusRequest)(nil), // 86: tabletmanagerdata.FullStatusRequest + (*FullStatusResponse)(nil), // 87: tabletmanagerdata.FullStatusResponse + (*SetReplicationSourceRequest)(nil), // 88: tabletmanagerdata.SetReplicationSourceRequest + (*SetReplicationSourceResponse)(nil), // 89: tabletmanagerdata.SetReplicationSourceResponse + (*ReplicaWasRestartedRequest)(nil), // 90: tabletmanagerdata.ReplicaWasRestartedRequest + (*ReplicaWasRestartedResponse)(nil), // 91: tabletmanagerdata.ReplicaWasRestartedResponse + (*StopReplicationAndGetStatusRequest)(nil), // 92: tabletmanagerdata.StopReplicationAndGetStatusRequest + (*StopReplicationAndGetStatusResponse)(nil), // 93: tabletmanagerdata.StopReplicationAndGetStatusResponse + (*PromoteReplicaRequest)(nil), // 94: tabletmanagerdata.PromoteReplicaRequest + (*PromoteReplicaResponse)(nil), // 95: tabletmanagerdata.PromoteReplicaResponse + (*BackupRequest)(nil), // 96: tabletmanagerdata.BackupRequest + (*BackupResponse)(nil), // 97: tabletmanagerdata.BackupResponse + (*RestoreFromBackupRequest)(nil), // 98: tabletmanagerdata.RestoreFromBackupRequest + (*RestoreFromBackupResponse)(nil), // 99: tabletmanagerdata.RestoreFromBackupResponse + (*CreateVReplicationWorkflowRequest)(nil), // 100: tabletmanagerdata.CreateVReplicationWorkflowRequest + (*CreateVReplicationWorkflowResponse)(nil), // 101: tabletmanagerdata.CreateVReplicationWorkflowResponse + (*DeleteVReplicationWorkflowRequest)(nil), // 102: tabletmanagerdata.DeleteVReplicationWorkflowRequest + (*DeleteVReplicationWorkflowResponse)(nil), // 103: tabletmanagerdata.DeleteVReplicationWorkflowResponse + (*ReadVReplicationWorkflowRequest)(nil), // 104: tabletmanagerdata.ReadVReplicationWorkflowRequest + (*ReadVReplicationWorkflowResponse)(nil), // 105: tabletmanagerdata.ReadVReplicationWorkflowResponse + (*VDiffRequest)(nil), // 106: tabletmanagerdata.VDiffRequest + (*VDiffResponse)(nil), // 107: tabletmanagerdata.VDiffResponse + (*VDiffPickerOptions)(nil), // 108: tabletmanagerdata.VDiffPickerOptions + (*VDiffReportOptions)(nil), // 109: tabletmanagerdata.VDiffReportOptions + (*VDiffCoreOptions)(nil), // 110: tabletmanagerdata.VDiffCoreOptions + (*VDiffOptions)(nil), // 111: tabletmanagerdata.VDiffOptions + (*UpdateVReplicationWorkflowRequest)(nil), // 112: tabletmanagerdata.UpdateVReplicationWorkflowRequest + (*UpdateVReplicationWorkflowResponse)(nil), // 113: tabletmanagerdata.UpdateVReplicationWorkflowResponse + (*ResetSequencesRequest)(nil), // 114: tabletmanagerdata.ResetSequencesRequest + (*ResetSequencesResponse)(nil), // 115: tabletmanagerdata.ResetSequencesResponse + (*CheckThrottlerRequest)(nil), // 116: tabletmanagerdata.CheckThrottlerRequest + (*CheckThrottlerResponse)(nil), // 117: tabletmanagerdata.CheckThrottlerResponse + nil, // 118: tabletmanagerdata.UserPermission.PrivilegesEntry + nil, // 119: tabletmanagerdata.DbPermission.PrivilegesEntry + nil, // 120: tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + (*ReadVReplicationWorkflowResponse_Stream)(nil), // 121: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + (*topodata.TabletAlias)(nil), // 122: topodata.TabletAlias + (*query.Field)(nil), // 123: query.Field + (topodata.TabletType)(0), // 124: topodata.TabletType + (*vtrpc.CallerID)(nil), // 125: vtrpc.CallerID + (*query.QueryResult)(nil), // 126: query.QueryResult + (*replicationdata.Status)(nil), // 127: replicationdata.Status + (*replicationdata.PrimaryStatus)(nil), // 128: replicationdata.PrimaryStatus + (*replicationdata.FullStatus)(nil), // 129: replicationdata.FullStatus + (replicationdata.StopReplicationMode)(0), // 130: replicationdata.StopReplicationMode + (*replicationdata.StopReplicationStatus)(nil), // 131: replicationdata.StopReplicationStatus + (*logutil.Event)(nil), // 132: logutil.Event + (*vttime.Time)(nil), // 133: vttime.Time + (*binlogdata.BinlogSource)(nil), // 134: binlogdata.BinlogSource + (binlogdata.VReplicationWorkflowType)(0), // 135: binlogdata.VReplicationWorkflowType + (binlogdata.VReplicationWorkflowSubType)(0), // 136: binlogdata.VReplicationWorkflowSubType + (binlogdata.OnDDLAction)(0), // 137: binlogdata.OnDDLAction + (binlogdata.VReplicationWorkflowState)(0), // 138: binlogdata.VReplicationWorkflowState } var file_tabletmanagerdata_proto_depIdxs = []int32{ - 119, // 0: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field - 1, // 1: tabletmanagerdata.SchemaDefinition.table_definitions:type_name -> tabletmanagerdata.TableDefinition - 2, // 2: tabletmanagerdata.SchemaChangeResult.before_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 3: tabletmanagerdata.SchemaChangeResult.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 115, // 4: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry - 116, // 5: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry - 4, // 6: tabletmanagerdata.Permissions.user_permissions:type_name -> tabletmanagerdata.UserPermission - 5, // 7: tabletmanagerdata.Permissions.db_permissions:type_name -> tabletmanagerdata.DbPermission - 117, // 8: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry - 2, // 9: tabletmanagerdata.GetSchemaResponse.schema_definition:type_name -> tabletmanagerdata.SchemaDefinition - 6, // 10: tabletmanagerdata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions - 120, // 11: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType - 3, // 12: tabletmanagerdata.PreflightSchemaResponse.change_results:type_name -> tabletmanagerdata.SchemaChangeResult - 2, // 13: tabletmanagerdata.ApplySchemaRequest.before_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 14: tabletmanagerdata.ApplySchemaRequest.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 15: tabletmanagerdata.ApplySchemaResponse.before_schema:type_name -> tabletmanagerdata.SchemaDefinition - 2, // 16: tabletmanagerdata.ApplySchemaResponse.after_schema:type_name -> tabletmanagerdata.SchemaDefinition - 121, // 17: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID - 122, // 18: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult - 122, // 19: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult - 122, // 20: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult - 122, // 21: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult - 123, // 22: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status - 124, // 23: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus - 122, // 24: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult - 125, // 25: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias - 125, // 26: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias - 124, // 27: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus - 126, // 28: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus - 125, // 29: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias - 125, // 30: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias - 127, // 31: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode - 128, // 32: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus - 129, // 33: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event - 130, // 34: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time - 130, // 35: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time - 129, // 36: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event - 131, // 37: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource - 120, // 38: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType - 0, // 39: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 132, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 133, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 122, // 42: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 122, // 43: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 120, // 44: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType - 0, // 45: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 132, // 46: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType - 133, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType - 118, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream - 108, // 49: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions - 122, // 50: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult - 105, // 51: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions - 107, // 52: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions - 106, // 53: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions - 120, // 54: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType - 0, // 55: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference - 134, // 56: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction - 135, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState - 122, // 58: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult - 131, // 59: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource - 130, // 60: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time - 130, // 61: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time - 135, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState - 130, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time - 130, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time - 65, // [65:65] is the sub-list for method output_type - 65, // [65:65] is the sub-list for method input_type - 65, // [65:65] is the sub-list for extension type_name - 65, // [65:65] is the sub-list for extension extendee - 0, // [0:65] is the sub-list for field type_name + 1, // 0: tabletmanagerdata.OnlineDDL.strategy:type_name -> tabletmanagerdata.OnlineDDL.Strategy + 2, // 1: tabletmanagerdata.OnlineDDL.status:type_name -> tabletmanagerdata.OnlineDDL.Status + 122, // 2: tabletmanagerdata.OnlineDDL.tablet_alias:type_name -> topodata.TabletAlias + 123, // 3: tabletmanagerdata.TableDefinition.fields:type_name -> query.Field + 4, // 4: tabletmanagerdata.SchemaDefinition.table_definitions:type_name -> tabletmanagerdata.TableDefinition + 5, // 5: tabletmanagerdata.SchemaChangeResult.before_schema:type_name -> tabletmanagerdata.SchemaDefinition + 5, // 6: tabletmanagerdata.SchemaChangeResult.after_schema:type_name -> tabletmanagerdata.SchemaDefinition + 118, // 7: tabletmanagerdata.UserPermission.privileges:type_name -> tabletmanagerdata.UserPermission.PrivilegesEntry + 119, // 8: tabletmanagerdata.DbPermission.privileges:type_name -> tabletmanagerdata.DbPermission.PrivilegesEntry + 7, // 9: tabletmanagerdata.Permissions.user_permissions:type_name -> tabletmanagerdata.UserPermission + 8, // 10: tabletmanagerdata.Permissions.db_permissions:type_name -> tabletmanagerdata.DbPermission + 120, // 11: tabletmanagerdata.ExecuteHookRequest.extra_env:type_name -> tabletmanagerdata.ExecuteHookRequest.ExtraEnvEntry + 5, // 12: tabletmanagerdata.GetSchemaResponse.schema_definition:type_name -> tabletmanagerdata.SchemaDefinition + 9, // 13: tabletmanagerdata.GetPermissionsResponse.permissions:type_name -> tabletmanagerdata.Permissions + 124, // 14: tabletmanagerdata.ChangeTypeRequest.tablet_type:type_name -> topodata.TabletType + 6, // 15: tabletmanagerdata.PreflightSchemaResponse.change_results:type_name -> tabletmanagerdata.SchemaChangeResult + 5, // 16: tabletmanagerdata.ApplySchemaRequest.before_schema:type_name -> tabletmanagerdata.SchemaDefinition + 5, // 17: tabletmanagerdata.ApplySchemaRequest.after_schema:type_name -> tabletmanagerdata.SchemaDefinition + 5, // 18: tabletmanagerdata.ApplySchemaResponse.before_schema:type_name -> tabletmanagerdata.SchemaDefinition + 5, // 19: tabletmanagerdata.ApplySchemaResponse.after_schema:type_name -> tabletmanagerdata.SchemaDefinition + 125, // 20: tabletmanagerdata.ExecuteQueryRequest.caller_id:type_name -> vtrpc.CallerID + 126, // 21: tabletmanagerdata.ExecuteQueryResponse.result:type_name -> query.QueryResult + 126, // 22: tabletmanagerdata.ExecuteFetchAsDbaResponse.result:type_name -> query.QueryResult + 126, // 23: tabletmanagerdata.ExecuteFetchAsAllPrivsResponse.result:type_name -> query.QueryResult + 126, // 24: tabletmanagerdata.ExecuteFetchAsAppResponse.result:type_name -> query.QueryResult + 127, // 25: tabletmanagerdata.ReplicationStatusResponse.status:type_name -> replicationdata.Status + 128, // 26: tabletmanagerdata.PrimaryStatusResponse.status:type_name -> replicationdata.PrimaryStatus + 126, // 27: tabletmanagerdata.VReplicationExecResponse.result:type_name -> query.QueryResult + 122, // 28: tabletmanagerdata.PopulateReparentJournalRequest.primary_alias:type_name -> topodata.TabletAlias + 122, // 29: tabletmanagerdata.InitReplicaRequest.parent:type_name -> topodata.TabletAlias + 128, // 30: tabletmanagerdata.DemotePrimaryResponse.primary_status:type_name -> replicationdata.PrimaryStatus + 129, // 31: tabletmanagerdata.FullStatusResponse.status:type_name -> replicationdata.FullStatus + 122, // 32: tabletmanagerdata.SetReplicationSourceRequest.parent:type_name -> topodata.TabletAlias + 122, // 33: tabletmanagerdata.ReplicaWasRestartedRequest.parent:type_name -> topodata.TabletAlias + 130, // 34: tabletmanagerdata.StopReplicationAndGetStatusRequest.stop_replication_mode:type_name -> replicationdata.StopReplicationMode + 131, // 35: tabletmanagerdata.StopReplicationAndGetStatusResponse.status:type_name -> replicationdata.StopReplicationStatus + 132, // 36: tabletmanagerdata.BackupResponse.event:type_name -> logutil.Event + 133, // 37: tabletmanagerdata.RestoreFromBackupRequest.backup_time:type_name -> vttime.Time + 133, // 38: tabletmanagerdata.RestoreFromBackupRequest.restore_to_timestamp:type_name -> vttime.Time + 132, // 39: tabletmanagerdata.RestoreFromBackupResponse.event:type_name -> logutil.Event + 134, // 40: tabletmanagerdata.CreateVReplicationWorkflowRequest.binlog_source:type_name -> binlogdata.BinlogSource + 124, // 41: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 42: tabletmanagerdata.CreateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 135, // 43: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 136, // 44: tabletmanagerdata.CreateVReplicationWorkflowRequest.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 126, // 45: tabletmanagerdata.CreateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 126, // 46: tabletmanagerdata.DeleteVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 124, // 47: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_types:type_name -> topodata.TabletType + 0, // 48: tabletmanagerdata.ReadVReplicationWorkflowResponse.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 135, // 49: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_type:type_name -> binlogdata.VReplicationWorkflowType + 136, // 50: tabletmanagerdata.ReadVReplicationWorkflowResponse.workflow_sub_type:type_name -> binlogdata.VReplicationWorkflowSubType + 121, // 51: tabletmanagerdata.ReadVReplicationWorkflowResponse.streams:type_name -> tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream + 111, // 52: tabletmanagerdata.VDiffRequest.options:type_name -> tabletmanagerdata.VDiffOptions + 126, // 53: tabletmanagerdata.VDiffResponse.output:type_name -> query.QueryResult + 108, // 54: tabletmanagerdata.VDiffOptions.picker_options:type_name -> tabletmanagerdata.VDiffPickerOptions + 110, // 55: tabletmanagerdata.VDiffOptions.core_options:type_name -> tabletmanagerdata.VDiffCoreOptions + 109, // 56: tabletmanagerdata.VDiffOptions.report_options:type_name -> tabletmanagerdata.VDiffReportOptions + 124, // 57: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_types:type_name -> topodata.TabletType + 0, // 58: tabletmanagerdata.UpdateVReplicationWorkflowRequest.tablet_selection_preference:type_name -> tabletmanagerdata.TabletSelectionPreference + 137, // 59: tabletmanagerdata.UpdateVReplicationWorkflowRequest.on_ddl:type_name -> binlogdata.OnDDLAction + 138, // 60: tabletmanagerdata.UpdateVReplicationWorkflowRequest.state:type_name -> binlogdata.VReplicationWorkflowState + 126, // 61: tabletmanagerdata.UpdateVReplicationWorkflowResponse.result:type_name -> query.QueryResult + 134, // 62: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.bls:type_name -> binlogdata.BinlogSource + 133, // 63: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_updated:type_name -> vttime.Time + 133, // 64: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.transaction_timestamp:type_name -> vttime.Time + 138, // 65: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.state:type_name -> binlogdata.VReplicationWorkflowState + 133, // 66: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_heartbeat:type_name -> vttime.Time + 133, // 67: tabletmanagerdata.ReadVReplicationWorkflowResponse.Stream.time_throttled:type_name -> vttime.Time + 68, // [68:68] is the sub-list for method output_type + 68, // [68:68] is the sub-list for method input_type + 68, // [68:68] is the sub-list for extension type_name + 68, // [68:68] is the sub-list for extension extendee + 0, // [0:68] is the sub-list for field type_name } func init() { file_tabletmanagerdata_proto_init() } @@ -7128,7 +7451,7 @@ func file_tabletmanagerdata_proto_init() { } if !protoimpl.UnsafeEnabled { file_tabletmanagerdata_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TableDefinition); i { + switch v := v.(*OnlineDDL); i { case 0: return &v.state case 1: @@ -7140,7 +7463,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemaDefinition); i { + switch v := v.(*TableDefinition); i { case 0: return &v.state case 1: @@ -7152,7 +7475,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SchemaChangeResult); i { + switch v := v.(*SchemaDefinition); i { case 0: return &v.state case 1: @@ -7164,7 +7487,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserPermission); i { + switch v := v.(*SchemaChangeResult); i { case 0: return &v.state case 1: @@ -7176,7 +7499,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DbPermission); i { + switch v := v.(*UserPermission); i { case 0: return &v.state case 1: @@ -7188,7 +7511,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Permissions); i { + switch v := v.(*DbPermission); i { case 0: return &v.state case 1: @@ -7200,7 +7523,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PingRequest); i { + switch v := v.(*Permissions); i { case 0: return &v.state case 1: @@ -7212,7 +7535,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PingResponse); i { + switch v := v.(*PingRequest); i { case 0: return &v.state case 1: @@ -7224,7 +7547,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SleepRequest); i { + switch v := v.(*PingResponse); i { case 0: return &v.state case 1: @@ -7236,7 +7559,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SleepResponse); i { + switch v := v.(*SleepRequest); i { case 0: return &v.state case 1: @@ -7248,7 +7571,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteHookRequest); i { + switch v := v.(*SleepResponse); i { case 0: return &v.state case 1: @@ -7260,7 +7583,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteHookResponse); i { + switch v := v.(*ExecuteHookRequest); i { case 0: return &v.state case 1: @@ -7272,7 +7595,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSchemaRequest); i { + switch v := v.(*ExecuteHookResponse); i { case 0: return &v.state case 1: @@ -7284,7 +7607,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetSchemaResponse); i { + switch v := v.(*GetSchemaRequest); i { case 0: return &v.state case 1: @@ -7296,7 +7619,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPermissionsRequest); i { + switch v := v.(*GetSchemaResponse); i { case 0: return &v.state case 1: @@ -7308,7 +7631,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetPermissionsResponse); i { + switch v := v.(*GetPermissionsRequest); i { case 0: return &v.state case 1: @@ -7320,7 +7643,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetReadOnlyRequest); i { + switch v := v.(*GetPermissionsResponse); i { case 0: return &v.state case 1: @@ -7332,7 +7655,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetReadOnlyResponse); i { + switch v := v.(*SetReadOnlyRequest); i { case 0: return &v.state case 1: @@ -7344,7 +7667,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetReadWriteRequest); i { + switch v := v.(*SetReadOnlyResponse); i { case 0: return &v.state case 1: @@ -7356,7 +7679,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetReadWriteResponse); i { + switch v := v.(*SetReadWriteRequest); i { case 0: return &v.state case 1: @@ -7368,7 +7691,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeTypeRequest); i { + switch v := v.(*SetReadWriteResponse); i { case 0: return &v.state case 1: @@ -7380,7 +7703,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangeTypeResponse); i { + switch v := v.(*ChangeTypeRequest); i { case 0: return &v.state case 1: @@ -7392,7 +7715,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RefreshStateRequest); i { + switch v := v.(*ChangeTypeResponse); i { case 0: return &v.state case 1: @@ -7404,7 +7727,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RefreshStateResponse); i { + switch v := v.(*RefreshStateRequest); i { case 0: return &v.state case 1: @@ -7416,7 +7739,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RunHealthCheckRequest); i { + switch v := v.(*RefreshStateResponse); i { case 0: return &v.state case 1: @@ -7428,7 +7751,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RunHealthCheckResponse); i { + switch v := v.(*RunHealthCheckRequest); i { case 0: return &v.state case 1: @@ -7440,7 +7763,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReloadSchemaRequest); i { + switch v := v.(*RunHealthCheckResponse); i { case 0: return &v.state case 1: @@ -7452,7 +7775,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReloadSchemaResponse); i { + switch v := v.(*ReloadSchemaRequest); i { case 0: return &v.state case 1: @@ -7464,7 +7787,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PreflightSchemaRequest); i { + switch v := v.(*ReloadSchemaResponse); i { case 0: return &v.state case 1: @@ -7476,7 +7799,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PreflightSchemaResponse); i { + switch v := v.(*PreflightSchemaRequest); i { case 0: return &v.state case 1: @@ -7488,7 +7811,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplySchemaRequest); i { + switch v := v.(*PreflightSchemaResponse); i { case 0: return &v.state case 1: @@ -7500,7 +7823,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ApplySchemaResponse); i { + switch v := v.(*ApplySchemaRequest); i { case 0: return &v.state case 1: @@ -7512,7 +7835,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LockTablesRequest); i { + switch v := v.(*ApplySchemaResponse); i { case 0: return &v.state case 1: @@ -7524,7 +7847,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LockTablesResponse); i { + switch v := v.(*LockTablesRequest); i { case 0: return &v.state case 1: @@ -7536,7 +7859,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnlockTablesRequest); i { + switch v := v.(*LockTablesResponse); i { case 0: return &v.state case 1: @@ -7548,7 +7871,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnlockTablesResponse); i { + switch v := v.(*UnlockTablesRequest); i { case 0: return &v.state case 1: @@ -7560,7 +7883,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteQueryRequest); i { + switch v := v.(*UnlockTablesResponse); i { case 0: return &v.state case 1: @@ -7572,7 +7895,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteQueryResponse); i { + switch v := v.(*ExecuteQueryRequest); i { case 0: return &v.state case 1: @@ -7584,7 +7907,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteFetchAsDbaRequest); i { + switch v := v.(*ExecuteQueryResponse); i { case 0: return &v.state case 1: @@ -7596,7 +7919,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteFetchAsDbaResponse); i { + switch v := v.(*ExecuteFetchAsDbaRequest); i { case 0: return &v.state case 1: @@ -7608,7 +7931,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteFetchAsAllPrivsRequest); i { + switch v := v.(*ExecuteFetchAsDbaResponse); i { case 0: return &v.state case 1: @@ -7620,7 +7943,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteFetchAsAllPrivsResponse); i { + switch v := v.(*ExecuteFetchAsAllPrivsRequest); i { case 0: return &v.state case 1: @@ -7632,7 +7955,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteFetchAsAppRequest); i { + switch v := v.(*ExecuteFetchAsAllPrivsResponse); i { case 0: return &v.state case 1: @@ -7644,7 +7967,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExecuteFetchAsAppResponse); i { + switch v := v.(*ExecuteFetchAsAppRequest); i { case 0: return &v.state case 1: @@ -7656,7 +7979,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplicationStatusRequest); i { + switch v := v.(*ExecuteFetchAsAppResponse); i { case 0: return &v.state case 1: @@ -7668,7 +7991,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplicationStatusResponse); i { + switch v := v.(*ReplicationStatusRequest); i { case 0: return &v.state case 1: @@ -7680,7 +8003,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryStatusRequest); i { + switch v := v.(*ReplicationStatusResponse); i { case 0: return &v.state case 1: @@ -7692,7 +8015,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryStatusResponse); i { + switch v := v.(*PrimaryStatusRequest); i { case 0: return &v.state case 1: @@ -7704,7 +8027,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryPositionRequest); i { + switch v := v.(*PrimaryStatusResponse); i { case 0: return &v.state case 1: @@ -7716,7 +8039,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryPositionResponse); i { + switch v := v.(*PrimaryPositionRequest); i { case 0: return &v.state case 1: @@ -7728,7 +8051,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitForPositionRequest); i { + switch v := v.(*PrimaryPositionResponse); i { case 0: return &v.state case 1: @@ -7740,7 +8063,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WaitForPositionResponse); i { + switch v := v.(*WaitForPositionRequest); i { case 0: return &v.state case 1: @@ -7752,7 +8075,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReplicationRequest); i { + switch v := v.(*WaitForPositionResponse); i { case 0: return &v.state case 1: @@ -7764,7 +8087,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReplicationResponse); i { + switch v := v.(*StopReplicationRequest); i { case 0: return &v.state case 1: @@ -7776,7 +8099,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReplicationMinimumRequest); i { + switch v := v.(*StopReplicationResponse); i { case 0: return &v.state case 1: @@ -7788,7 +8111,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReplicationMinimumResponse); i { + switch v := v.(*StopReplicationMinimumRequest); i { case 0: return &v.state case 1: @@ -7800,7 +8123,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReplicationRequest); i { + switch v := v.(*StopReplicationMinimumResponse); i { case 0: return &v.state case 1: @@ -7812,7 +8135,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReplicationResponse); i { + switch v := v.(*StartReplicationRequest); i { case 0: return &v.state case 1: @@ -7824,7 +8147,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReplicationUntilAfterRequest); i { + switch v := v.(*StartReplicationResponse); i { case 0: return &v.state case 1: @@ -7836,7 +8159,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StartReplicationUntilAfterResponse); i { + switch v := v.(*StartReplicationUntilAfterRequest); i { case 0: return &v.state case 1: @@ -7848,7 +8171,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReplicasRequest); i { + switch v := v.(*StartReplicationUntilAfterResponse); i { case 0: return &v.state case 1: @@ -7860,7 +8183,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetReplicasResponse); i { + switch v := v.(*GetReplicasRequest); i { case 0: return &v.state case 1: @@ -7872,7 +8195,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetReplicationRequest); i { + switch v := v.(*GetReplicasResponse); i { case 0: return &v.state case 1: @@ -7884,7 +8207,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetReplicationResponse); i { + switch v := v.(*ResetReplicationRequest); i { case 0: return &v.state case 1: @@ -7896,7 +8219,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VReplicationExecRequest); i { + switch v := v.(*ResetReplicationResponse); i { case 0: return &v.state case 1: @@ -7908,7 +8231,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VReplicationExecResponse); i { + switch v := v.(*VReplicationExecRequest); i { case 0: return &v.state case 1: @@ -7920,7 +8243,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VReplicationWaitForPosRequest); i { + switch v := v.(*VReplicationExecResponse); i { case 0: return &v.state case 1: @@ -7932,7 +8255,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VReplicationWaitForPosResponse); i { + switch v := v.(*VReplicationWaitForPosRequest); i { case 0: return &v.state case 1: @@ -7944,7 +8267,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitPrimaryRequest); i { + switch v := v.(*VReplicationWaitForPosResponse); i { case 0: return &v.state case 1: @@ -7956,7 +8279,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitPrimaryResponse); i { + switch v := v.(*InitPrimaryRequest); i { case 0: return &v.state case 1: @@ -7968,7 +8291,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PopulateReparentJournalRequest); i { + switch v := v.(*InitPrimaryResponse); i { case 0: return &v.state case 1: @@ -7980,7 +8303,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PopulateReparentJournalResponse); i { + switch v := v.(*PopulateReparentJournalRequest); i { case 0: return &v.state case 1: @@ -7992,7 +8315,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitReplicaRequest); i { + switch v := v.(*PopulateReparentJournalResponse); i { case 0: return &v.state case 1: @@ -8004,7 +8327,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InitReplicaResponse); i { + switch v := v.(*InitReplicaRequest); i { case 0: return &v.state case 1: @@ -8016,7 +8339,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DemotePrimaryRequest); i { + switch v := v.(*InitReplicaResponse); i { case 0: return &v.state case 1: @@ -8028,7 +8351,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DemotePrimaryResponse); i { + switch v := v.(*DemotePrimaryRequest); i { case 0: return &v.state case 1: @@ -8040,7 +8363,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UndoDemotePrimaryRequest); i { + switch v := v.(*DemotePrimaryResponse); i { case 0: return &v.state case 1: @@ -8052,7 +8375,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UndoDemotePrimaryResponse); i { + switch v := v.(*UndoDemotePrimaryRequest); i { case 0: return &v.state case 1: @@ -8064,7 +8387,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplicaWasPromotedRequest); i { + switch v := v.(*UndoDemotePrimaryResponse); i { case 0: return &v.state case 1: @@ -8076,7 +8399,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplicaWasPromotedResponse); i { + switch v := v.(*ReplicaWasPromotedRequest); i { case 0: return &v.state case 1: @@ -8088,7 +8411,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetReplicationParametersRequest); i { + switch v := v.(*ReplicaWasPromotedResponse); i { case 0: return &v.state case 1: @@ -8100,7 +8423,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetReplicationParametersResponse); i { + switch v := v.(*ResetReplicationParametersRequest); i { case 0: return &v.state case 1: @@ -8112,7 +8435,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FullStatusRequest); i { + switch v := v.(*ResetReplicationParametersResponse); i { case 0: return &v.state case 1: @@ -8124,7 +8447,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FullStatusResponse); i { + switch v := v.(*FullStatusRequest); i { case 0: return &v.state case 1: @@ -8136,7 +8459,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetReplicationSourceRequest); i { + switch v := v.(*FullStatusResponse); i { case 0: return &v.state case 1: @@ -8148,7 +8471,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetReplicationSourceResponse); i { + switch v := v.(*SetReplicationSourceRequest); i { case 0: return &v.state case 1: @@ -8160,7 +8483,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplicaWasRestartedRequest); i { + switch v := v.(*SetReplicationSourceResponse); i { case 0: return &v.state case 1: @@ -8172,7 +8495,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReplicaWasRestartedResponse); i { + switch v := v.(*ReplicaWasRestartedRequest); i { case 0: return &v.state case 1: @@ -8184,7 +8507,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReplicationAndGetStatusRequest); i { + switch v := v.(*ReplicaWasRestartedResponse); i { case 0: return &v.state case 1: @@ -8196,7 +8519,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StopReplicationAndGetStatusResponse); i { + switch v := v.(*StopReplicationAndGetStatusRequest); i { case 0: return &v.state case 1: @@ -8208,7 +8531,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PromoteReplicaRequest); i { + switch v := v.(*StopReplicationAndGetStatusResponse); i { case 0: return &v.state case 1: @@ -8220,7 +8543,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PromoteReplicaResponse); i { + switch v := v.(*PromoteReplicaRequest); i { case 0: return &v.state case 1: @@ -8232,7 +8555,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackupRequest); i { + switch v := v.(*PromoteReplicaResponse); i { case 0: return &v.state case 1: @@ -8244,7 +8567,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BackupResponse); i { + switch v := v.(*BackupRequest); i { case 0: return &v.state case 1: @@ -8256,7 +8579,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestoreFromBackupRequest); i { + switch v := v.(*BackupResponse); i { case 0: return &v.state case 1: @@ -8268,7 +8591,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RestoreFromBackupResponse); i { + switch v := v.(*RestoreFromBackupRequest); i { case 0: return &v.state case 1: @@ -8280,7 +8603,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateVReplicationWorkflowRequest); i { + switch v := v.(*RestoreFromBackupResponse); i { case 0: return &v.state case 1: @@ -8292,7 +8615,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateVReplicationWorkflowResponse); i { + switch v := v.(*CreateVReplicationWorkflowRequest); i { case 0: return &v.state case 1: @@ -8304,7 +8627,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteVReplicationWorkflowRequest); i { + switch v := v.(*CreateVReplicationWorkflowResponse); i { case 0: return &v.state case 1: @@ -8316,7 +8639,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteVReplicationWorkflowResponse); i { + switch v := v.(*DeleteVReplicationWorkflowRequest); i { case 0: return &v.state case 1: @@ -8328,7 +8651,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadVReplicationWorkflowRequest); i { + switch v := v.(*DeleteVReplicationWorkflowResponse); i { case 0: return &v.state case 1: @@ -8340,7 +8663,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReadVReplicationWorkflowResponse); i { + switch v := v.(*ReadVReplicationWorkflowRequest); i { case 0: return &v.state case 1: @@ -8352,7 +8675,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffRequest); i { + switch v := v.(*ReadVReplicationWorkflowResponse); i { case 0: return &v.state case 1: @@ -8364,7 +8687,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffResponse); i { + switch v := v.(*VDiffRequest); i { case 0: return &v.state case 1: @@ -8376,7 +8699,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffPickerOptions); i { + switch v := v.(*VDiffResponse); i { case 0: return &v.state case 1: @@ -8388,7 +8711,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffReportOptions); i { + switch v := v.(*VDiffPickerOptions); i { case 0: return &v.state case 1: @@ -8400,7 +8723,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffCoreOptions); i { + switch v := v.(*VDiffReportOptions); i { case 0: return &v.state case 1: @@ -8412,7 +8735,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VDiffOptions); i { + switch v := v.(*VDiffCoreOptions); i { case 0: return &v.state case 1: @@ -8424,7 +8747,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateVReplicationWorkflowRequest); i { + switch v := v.(*VDiffOptions); i { case 0: return &v.state case 1: @@ -8436,7 +8759,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateVReplicationWorkflowResponse); i { + switch v := v.(*UpdateVReplicationWorkflowRequest); i { case 0: return &v.state case 1: @@ -8448,7 +8771,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetSequencesRequest); i { + switch v := v.(*UpdateVReplicationWorkflowResponse); i { case 0: return &v.state case 1: @@ -8460,7 +8783,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetSequencesResponse); i { + switch v := v.(*ResetSequencesRequest); i { case 0: return &v.state case 1: @@ -8472,7 +8795,7 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CheckThrottlerRequest); i { + switch v := v.(*ResetSequencesResponse); i { case 0: return &v.state case 1: @@ -8484,6 +8807,18 @@ func file_tabletmanagerdata_proto_init() { } } file_tabletmanagerdata_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CheckThrottlerRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_tabletmanagerdata_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CheckThrottlerResponse); i { case 0: return &v.state @@ -8495,7 +8830,7 @@ func file_tabletmanagerdata_proto_init() { return nil } } - file_tabletmanagerdata_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { + file_tabletmanagerdata_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ReadVReplicationWorkflowResponse_Stream); i { case 0: return &v.state @@ -8513,8 +8848,8 @@ func file_tabletmanagerdata_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_tabletmanagerdata_proto_rawDesc, - NumEnums: 1, - NumMessages: 118, + NumEnums: 3, + NumMessages: 119, NumExtensions: 0, NumServices: 0, }, diff --git a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go index a73a97268d3..cb25450ced0 100644 --- a/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go +++ b/go/vt/proto/tabletmanagerdata/tabletmanagerdata_vtproto.pb.go @@ -27,6 +27,133 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +func (m *OnlineDDL) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OnlineDDL) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *OnlineDDL) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.WasReadyToComplete { + i-- + if m.WasReadyToComplete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x68 + } + if m.ReadyToComplete { + i-- + if m.ReadyToComplete { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x60 + } + if m.Retries != 0 { + i = encodeVarint(dAtA, i, uint64(m.Retries)) + i-- + dAtA[i] = 0x58 + } + if m.TabletAlias != nil { + size, err := m.TabletAlias.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + if m.Status != 0 { + i = encodeVarint(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x48 + } + if len(m.MigrationContext) > 0 { + i -= len(m.MigrationContext) + copy(dAtA[i:], m.MigrationContext) + i = encodeVarint(dAtA, i, uint64(len(m.MigrationContext))) + i-- + dAtA[i] = 0x42 + } + if len(m.Options) > 0 { + i -= len(m.Options) + copy(dAtA[i:], m.Options) + i = encodeVarint(dAtA, i, uint64(len(m.Options))) + i-- + dAtA[i] = 0x3a + } + if m.Strategy != 0 { + i = encodeVarint(dAtA, i, uint64(m.Strategy)) + i-- + dAtA[i] = 0x30 + } + if len(m.Uuid) > 0 { + i -= len(m.Uuid) + copy(dAtA[i:], m.Uuid) + i = encodeVarint(dAtA, i, uint64(len(m.Uuid))) + i-- + dAtA[i] = 0x2a + } + if len(m.Sql) > 0 { + i -= len(m.Sql) + copy(dAtA[i:], m.Sql) + i = encodeVarint(dAtA, i, uint64(len(m.Sql))) + i-- + dAtA[i] = 0x22 + } + if len(m.Schema) > 0 { + i -= len(m.Schema) + copy(dAtA[i:], m.Schema) + i = encodeVarint(dAtA, i, uint64(len(m.Schema))) + i-- + dAtA[i] = 0x1a + } + if len(m.Table) > 0 { + i -= len(m.Table) + copy(dAtA[i:], m.Table) + i = encodeVarint(dAtA, i, uint64(len(m.Table))) + i-- + dAtA[i] = 0x12 + } + if len(m.Keyspace) > 0 { + i -= len(m.Keyspace) + copy(dAtA[i:], m.Keyspace) + i = encodeVarint(dAtA, i, uint64(len(m.Keyspace))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *TableDefinition) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil @@ -5464,6 +5591,63 @@ func encodeVarint(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *OnlineDDL) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Keyspace) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Table) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Schema) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Sql) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Uuid) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Strategy != 0 { + n += 1 + sov(uint64(m.Strategy)) + } + l = len(m.Options) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.MigrationContext) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + if m.Status != 0 { + n += 1 + sov(uint64(m.Status)) + } + if m.TabletAlias != nil { + l = m.TabletAlias.SizeVT() + n += 1 + l + sov(uint64(l)) + } + if m.Retries != 0 { + n += 1 + sov(uint64(m.Retries)) + } + if m.ReadyToComplete { + n += 2 + } + if m.WasReadyToComplete { + n += 2 + } + n += len(m.unknownFields) + return n +} + func (m *TableDefinition) SizeVT() (n int) { if m == nil { return 0 @@ -7391,6 +7575,414 @@ func sov(x uint64) (n int) { func soz(x uint64) (n int) { return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *OnlineDDL) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OnlineDDL: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OnlineDDL: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keyspace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keyspace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Table", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Table = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schema", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schema = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sql", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sql = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uuid", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uuid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Strategy", wireType) + } + m.Strategy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Strategy |= OnlineDDL_Strategy(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Options", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Options = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MigrationContext", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MigrationContext = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= OnlineDDL_Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TabletAlias", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TabletAlias == nil { + m.TabletAlias = &topodata.TabletAlias{} + } + if err := m.TabletAlias.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Retries", wireType) + } + m.Retries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Retries |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadyToComplete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ReadyToComplete = bool(v != 0) + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WasReadyToComplete", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.WasReadyToComplete = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *TableDefinition) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/go/vt/schema/cached_size.go b/go/vt/schema/cached_size.go index a2ea8f55deb..e42dae1125f 100644 --- a/go/vt/schema/cached_size.go +++ b/go/vt/schema/cached_size.go @@ -25,10 +25,8 @@ func (cached *DDLStrategySetting) CachedSize(alloc bool) int64 { } size := int64(0) if alloc { - size += int64(32) + size += int64(24) } - // field Strategy vitess.io/vitess/go/vt/schema.DDLStrategy - size += hack.RuntimeAllocSize(int64(len(cached.Strategy))) // field Options string size += hack.RuntimeAllocSize(int64(len(cached.Options))) return size diff --git a/go/vt/schema/ddl_strategy.go b/go/vt/schema/ddl_strategy.go index 83c39da62d6..7b772035418 100644 --- a/go/vt/schema/ddl_strategy.go +++ b/go/vt/schema/ddl_strategy.go @@ -20,9 +20,14 @@ import ( "fmt" "regexp" "strconv" + "strings" "time" "github.com/google/shlex" + + "vitess.io/vitess/go/vt/log" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) var ( @@ -48,42 +53,14 @@ const ( analyzeTableFlag = "analyze-table" ) -// DDLStrategy suggests how an ALTER TABLE should run (e.g. "direct", "online", "gh-ost" or "pt-osc") -type DDLStrategy string - -const ( - // DDLStrategyDirect means not an online-ddl migration; unmanaged. Just a normal MySQL `ALTER TABLE` - DDLStrategyDirect DDLStrategy = "direct" - // DDLStrategyVitess requests vreplication to run the migration; new name for DDLStrategyOnline - DDLStrategyVitess DDLStrategy = "vitess" - // DDLStrategyOnline requests vreplication to run the migration - DDLStrategyOnline DDLStrategy = "online" - // DDLStrategyGhost requests gh-ost to run the migration - DDLStrategyGhost DDLStrategy = "gh-ost" - // DDLStrategyPTOSC requests pt-online-schema-change to run the migration - DDLStrategyPTOSC DDLStrategy = "pt-osc" - // DDLStrategyMySQL is a managed migration (queued and executed by the scheduler) but runs through a MySQL `ALTER TABLE` - DDLStrategyMySQL DDLStrategy = "mysql" -) - -// IsDirect returns true if this strategy is a direct strategy -// A strategy is direct if it's not explciitly one of the online DDL strategies -func (s DDLStrategy) IsDirect() bool { - switch s { - case DDLStrategyVitess, DDLStrategyOnline, DDLStrategyGhost, DDLStrategyPTOSC, DDLStrategyMySQL: - return false - } - return true -} - // DDLStrategySetting is a formal breakdown of the @@ddl_strategy variable, into strategy and options type DDLStrategySetting struct { - Strategy DDLStrategy `json:"strategy,omitempty"` - Options string `json:"options,omitempty"` + Strategy tabletmanagerdatapb.OnlineDDL_Strategy `json:"strategy,omitempty"` + Options string `json:"options,omitempty"` } // NewDDLStrategySetting instantiates a new setting -func NewDDLStrategySetting(strategy DDLStrategy, options string) *DDLStrategySetting { +func NewDDLStrategySetting(strategy tabletmanagerdatapb.OnlineDDL_Strategy, options string) *DDLStrategySetting { return &DDLStrategySetting{ Strategy: strategy, Options: options, @@ -99,13 +76,10 @@ func ParseDDLStrategy(strategyVariable string) (*DDLStrategySetting, error) { setting.Options = submatch[2] } - switch strategy := DDLStrategy(strategyName); strategy { - case "": // backward compatiblity and to handle unspecified values - setting.Strategy = DDLStrategyDirect - case DDLStrategyVitess, DDLStrategyOnline, DDLStrategyGhost, DDLStrategyPTOSC, DDLStrategyMySQL, DDLStrategyDirect: - setting.Strategy = strategy - default: - return nil, fmt.Errorf("Unknown online DDL strategy: '%v'", strategy) + var err error + setting.Strategy, err = ParseDDLStrategyName(strategyName) + if err != nil { + return nil, err } if _, err := setting.CutOverThreshold(); err != nil { return nil, err @@ -113,6 +87,45 @@ func ParseDDLStrategy(strategyVariable string) (*DDLStrategySetting, error) { return setting, nil } +func ParseDDLStrategyName(name string) (tabletmanagerdatapb.OnlineDDL_Strategy, error) { + if name == "" { + // backward compatiblity and to handle unspecified values + return tabletmanagerdatapb.OnlineDDL_DIRECT, nil + } + + lowerName := strings.ToUpper(name) + switch lowerName { + case "GH-OST", "PT-OSC": + // more backward compatibility since the protobuf message names don't + // have the dash. + lowerName = strings.ReplaceAll(lowerName, "-", "") + default: + } + + strategy, ok := tabletmanagerdatapb.OnlineDDL_Strategy_value[lowerName] + if !ok { + return 0, fmt.Errorf("unknown online DDL strategy: '%v'", name) + } + + if lowerName != name { + // TODO (andrew): Remove special handling for lower/uppercase and + // gh-ost=>ghost/pt-osc=>ptosc support. (file issue for this). + log.Warningf("detected legacy strategy name syntax; parsed %q as %q. this break in the next version.", lowerName, name) + } + + return tabletmanagerdatapb.OnlineDDL_Strategy(strategy), nil +} + +// OnlineDDLStrategyName returns the text-based form of the strategy. +func OnlineDDLStrategyName(strategy tabletmanagerdatapb.OnlineDDL_Strategy) string { + name, ok := tabletmanagerdatapb.OnlineDDL_Strategy_name[int32(strategy)] + if !ok { + return "unknown" + } + + return strings.ToLower(name) +} + // isFlag return true when the given string is a CLI flag of the given name func isFlag(s string, name string) bool { if s == fmt.Sprintf("-%s", name) { @@ -140,6 +153,23 @@ func (setting *DDLStrategySetting) IsDeclarative() bool { return setting.hasFlag(declarativeFlag) } +// IsDirect returns true if this strategy is a direct strategy +// A strategy is direct if it's not explciitly one of the online DDL strategies +func (setting *DDLStrategySetting) IsDirect() bool { + switch setting.Strategy { + case tabletmanagerdatapb.OnlineDDL_VITESS, + // N.B. duplicate value as OnlineDDL_VITESS; comment left here deliberately + // so future readers know it was not omitted by mistake. + /* tabletmanagerdatapb.OnlineDDL_ONLINE, */ + tabletmanagerdatapb.OnlineDDL_GHOST, + tabletmanagerdatapb.OnlineDDL_PTOSC, + tabletmanagerdatapb.OnlineDDL_MYSQL: + + return false + } + return true +} + // IsSingleton checks if strategy options include --singleton func (setting *DDLStrategySetting) IsSingleton() bool { return setting.hasFlag(singletonFlag) diff --git a/go/vt/schema/ddl_strategy_test.go b/go/vt/schema/ddl_strategy_test.go index c0d81114602..2a5fa8ef7d7 100644 --- a/go/vt/schema/ddl_strategy_test.go +++ b/go/vt/schema/ddl_strategy_test.go @@ -22,21 +22,40 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) func TestIsDirect(t *testing.T) { - assert.True(t, DDLStrategyDirect.IsDirect()) - assert.False(t, DDLStrategyVitess.IsDirect()) - assert.False(t, DDLStrategyOnline.IsDirect()) - assert.False(t, DDLStrategyGhost.IsDirect()) - assert.False(t, DDLStrategyPTOSC.IsDirect()) - assert.True(t, DDLStrategy("").IsDirect()) - assert.False(t, DDLStrategy("vitess").IsDirect()) - assert.False(t, DDLStrategy("online").IsDirect()) - assert.False(t, DDLStrategy("gh-ost").IsDirect()) - assert.False(t, DDLStrategy("pt-osc").IsDirect()) - assert.False(t, DDLStrategy("mysql").IsDirect()) - assert.True(t, DDLStrategy("something").IsDirect()) + assert.True(t, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_DIRECT, "").IsDirect()) + assert.False(t, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, "").IsDirect()) + assert.False(t, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_ONLINE, "").IsDirect()) + assert.False(t, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_GHOST, "").IsDirect()) + assert.False(t, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_PTOSC, "").IsDirect()) + assert.False(t, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_MYSQL, "").IsDirect()) + + for name, direct := range map[string]bool{ + "": true, + "vitess": false, + "online": false, + "gh-ost": false, + "pt-osc": false, + "mysql": false, + } { + strategy, err := ParseDDLStrategyName(name) + require.NoError(t, err) + + var assertion func(t assert.TestingT, value bool, msgAndArgs ...any) bool + switch direct { + case true: + assertion = assert.True + case false: + assertion = assert.False + } + + assertion(t, NewDDLStrategySetting(strategy, "").IsDirect()) + } } func TestIsCutOverThresholdFlag(t *testing.T) { @@ -105,7 +124,7 @@ func TestIsCutOverThresholdFlag(t *testing.T) { func TestParseDDLStrategy(t *testing.T) { tt := []struct { strategyVariable string - strategy DDLStrategy + strategy tabletmanagerdatapb.OnlineDDL_Strategy options string isDeclarative bool isSingleton bool @@ -123,125 +142,125 @@ func TestParseDDLStrategy(t *testing.T) { }{ { strategyVariable: "direct", - strategy: DDLStrategyDirect, + strategy: tabletmanagerdatapb.OnlineDDL_DIRECT, }, { strategyVariable: "vitess", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, }, { strategyVariable: "online", - strategy: DDLStrategyOnline, + strategy: tabletmanagerdatapb.OnlineDDL_ONLINE, }, { strategyVariable: "gh-ost", - strategy: DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, }, { strategyVariable: "pt-osc", - strategy: DDLStrategyPTOSC, + strategy: tabletmanagerdatapb.OnlineDDL_PTOSC, }, { strategyVariable: "mysql", - strategy: DDLStrategyMySQL, + strategy: tabletmanagerdatapb.OnlineDDL_MYSQL, }, { - strategy: DDLStrategyDirect, + strategy: tabletmanagerdatapb.OnlineDDL_DIRECT, }, { strategyVariable: "gh-ost --max-load=Threads_running=100 --allow-master", - strategy: DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, // These are gh-ost options. Nothing we can do until that changes upstream options: "--max-load=Threads_running=100 --allow-master", runtimeOptions: "--max-load=Threads_running=100 --allow-master", }, { strategyVariable: "gh-ost --max-load=Threads_running=100 -declarative", - strategy: DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, options: "--max-load=Threads_running=100 -declarative", runtimeOptions: "--max-load=Threads_running=100", isDeclarative: true, }, { strategyVariable: "gh-ost --declarative --max-load=Threads_running=100", - strategy: DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, options: "--declarative --max-load=Threads_running=100", runtimeOptions: "--max-load=Threads_running=100", isDeclarative: true, }, { strategyVariable: "pt-osc -singleton", - strategy: DDLStrategyPTOSC, + strategy: tabletmanagerdatapb.OnlineDDL_PTOSC, options: "-singleton", runtimeOptions: "", isSingleton: true, }, { strategyVariable: "online -postpone-launch", - strategy: DDLStrategyOnline, + strategy: tabletmanagerdatapb.OnlineDDL_ONLINE, options: "-postpone-launch", runtimeOptions: "", isPostponeLaunch: true, }, { strategyVariable: "online -postpone-completion", - strategy: DDLStrategyOnline, + strategy: tabletmanagerdatapb.OnlineDDL_ONLINE, options: "-postpone-completion", runtimeOptions: "", isPostponeCompletion: true, }, { strategyVariable: "online --in-order-completion", - strategy: DDLStrategyOnline, + strategy: tabletmanagerdatapb.OnlineDDL_ONLINE, options: "--in-order-completion", runtimeOptions: "", isInOrderCompletion: true, }, { strategyVariable: "online -allow-concurrent", - strategy: DDLStrategyOnline, + strategy: tabletmanagerdatapb.OnlineDDL_ONLINE, options: "-allow-concurrent", runtimeOptions: "", isAllowConcurrent: true, }, { strategyVariable: "vitess -allow-concurrent", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, options: "-allow-concurrent", runtimeOptions: "", isAllowConcurrent: true, }, { strategyVariable: "vitess --prefer-instant-ddl", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, options: "--prefer-instant-ddl", runtimeOptions: "", fastOverRevertible: true, }, { strategyVariable: "vitess --fast-range-rotation", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, options: "--fast-range-rotation", runtimeOptions: "", fastRangeRotation: true, }, { strategyVariable: "vitess --unsafe-allow-foreign-keys", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, options: "--unsafe-allow-foreign-keys", runtimeOptions: "", allowForeignKeys: true, }, { strategyVariable: "vitess --cut-over-threshold=5m", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, options: "--cut-over-threshold=5m", runtimeOptions: "", cutOverThreshold: 5 * time.Minute, }, { strategyVariable: "vitess --analyze-table", - strategy: DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, options: "--analyze-table", runtimeOptions: "", analyzeTable: true, diff --git a/go/vt/schema/internal/hooks/decode.go b/go/vt/schema/internal/hooks/decode.go new file mode 100644 index 00000000000..ced817ca695 --- /dev/null +++ b/go/vt/schema/internal/hooks/decode.go @@ -0,0 +1,177 @@ +/* +Copyright 2023 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package hooks provides internal mapstructure decode hooks used in schema.FromJSON +// to support backwards compatibility with the pre-protobuf message json structure. +// +// Do not use these; they are already deprecated and will be removed in v17 along +// with the older json format. +package hooks + +import ( + "fmt" + "reflect" + "strings" + + "vitess.io/vitess/go/vt/log" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" +) + +func DecodeReadyToComplete(from, to reflect.Type, data any) (any, error) { + if to != reflect.TypeOf(true) { + return data, nil + } + + var iVal int64 + switch from.Kind() { + case reflect.Bool: + return data.(bool), nil + case reflect.Int: + iVal = int64(data.(int)) + case reflect.Int32: + iVal = int64(data.(int32)) + case reflect.Int64: + iVal = data.(int64) + case reflect.Float32: + iVal = int64(data.(float32)) + case reflect.Float64: + iVal = int64(data.(float64)) + default: + return nil, fmt.Errorf("invalid type %s for ReadyToComplete field", from.Kind()) + } + + // The legacy ReadyToComplete is set to 1 when a migration is ready. We're + // being a bit more permissive here. + return iVal != 0, nil +} + +var status tabletmanagerdatapb.OnlineDDL_Status + +func DecodeStatus(from, to reflect.Type, data any) (any, error) { + if to != reflect.TypeOf(status) { + return data, nil + } + + var iVal int32 + switch from.Kind() { + case reflect.String: + data := data.(string) + name := strings.ToUpper(data) + + // duplication of schema.ParseOnlineDDLStatus to avoid import cycle. + val, ok := tabletmanagerdatapb.OnlineDDL_Status_value[name] + if !ok { + return nil, fmt.Errorf("unknown enum name for OnlineDDL_Status: %s", data) + } + + if name != data { + log.Warningf("legacy status name %s parsed as %s. this will break in a future release.", data, name) + } + + return val, nil + case reflect.Int: + iVal = int32(data.(int)) + case reflect.Int32: + iVal = data.(int32) + case reflect.Int64: + iVal = int32(data.(int64)) + case reflect.Float32: + iVal = int32(data.(float32)) + case reflect.Float64: + iVal = int32(data.(float64)) + default: + return nil, fmt.Errorf("invalid type %s for OnlineDDL_Status enum", from.Kind()) + } + + if _, ok := tabletmanagerdatapb.OnlineDDL_Status_name[iVal]; !ok { + return nil, fmt.Errorf("unknown enum value for OnlineDDL_Status: %d", iVal) + } + + return tabletmanagerdatapb.OnlineDDL_Status(iVal), nil +} + +var strategy tabletmanagerdatapb.OnlineDDL_Strategy + +func DecodeStrategy(from, to reflect.Type, data any) (any, error) { + if to != reflect.TypeOf(strategy) { + return data, nil + } + + var iVal int32 + switch from.Kind() { + case reflect.String: + data := data.(string) + name := strings.ToUpper(strings.ReplaceAll(data, "-", "")) + + // duplication of schema.ParseOnlineDDLStrategyName to avoid import cycle. + val, ok := tabletmanagerdatapb.OnlineDDL_Strategy_value[name] + if !ok { + return nil, fmt.Errorf("unknown enum name for OnlineDDL_Strategy: %s", data) + } + + if name != data { + log.Warningf("detected legacy strategy name syntax; parsed %q as %q. this break in the next version.", data, name) + } + + return val, nil + case reflect.Int: + iVal = int32(data.(int)) + case reflect.Int32: + iVal = data.(int32) + case reflect.Int64: + iVal = int32(data.(int64)) + case reflect.Float32: + iVal = int32(data.(float32)) + case reflect.Float64: + iVal = int32(data.(float64)) + default: + return nil, fmt.Errorf("invalid type %s for OnlineDDL_Strategy enum", from.Kind()) + } + + if _, ok := tabletmanagerdatapb.OnlineDDL_Strategy_name[iVal]; !ok { + return nil, fmt.Errorf("unknown enum value for OnlineDDL_Strategy: %d", iVal) + } + + return tabletmanagerdatapb.OnlineDDL_Strategy(iVal), nil +} + +func DecodeWasReadyToComplete(from, to reflect.Type, data any) (any, error) { + if to != reflect.TypeOf(true) { + return data, nil + } + + var iVal int64 + switch from.Kind() { + case reflect.Bool: + return data.(bool), nil + case reflect.Int: + iVal = int64(data.(int)) + case reflect.Int32: + iVal = int64(data.(int32)) + case reflect.Int64: + iVal = data.(int64) + case reflect.Float32: + iVal = int64(data.(float32)) + case reflect.Float64: + iVal = int64(data.(float64)) + default: + return nil, fmt.Errorf("invalid type %s for WasReadyToComplete field", from.Kind()) + } + + // The legacy WasReadyToComplete is set to 1 when a migration is ready. + // We're being a bit more permissive here. + return iVal != 0, nil +} diff --git a/go/vt/schema/online_ddl.go b/go/vt/schema/online_ddl.go index 889caf811bc..e950bd44a5d 100644 --- a/go/vt/schema/online_ddl.go +++ b/go/vt/schema/online_ddl.go @@ -24,10 +24,18 @@ import ( "regexp" "strconv" "strings" + "sync" + "github.com/mitchellh/mapstructure" + + "vitess.io/vitess/go/vt/log" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" + "vitess.io/vitess/go/vt/schema/internal/hooks" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vterrors" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) var ( @@ -68,42 +76,126 @@ func validateWalk(node sqlparser.SQLNode, allowForeignKeys bool) (kontinue bool, return false, nil } -// OnlineDDLStatus is an indicator to a online DDL status -type OnlineDDLStatus string - -const ( - OnlineDDLStatusRequested OnlineDDLStatus = "requested" - OnlineDDLStatusCancelled OnlineDDLStatus = "cancelled" - OnlineDDLStatusQueued OnlineDDLStatus = "queued" - OnlineDDLStatusReady OnlineDDLStatus = "ready" - OnlineDDLStatusRunning OnlineDDLStatus = "running" - OnlineDDLStatusComplete OnlineDDLStatus = "complete" - OnlineDDLStatusFailed OnlineDDLStatus = "failed" -) - // OnlineDDL encapsulates the relevant information in an online schema change request type OnlineDDL struct { - Keyspace string `json:"keyspace,omitempty"` - Table string `json:"table,omitempty"` - Schema string `json:"schema,omitempty"` - SQL string `json:"sql,omitempty"` - UUID string `json:"uuid,omitempty"` - Strategy DDLStrategy `json:"strategy,omitempty"` - Options string `json:"options,omitempty"` + // m is used to provide concurrent access to ReadyToComplete logic. Callers + // should use the IsReadyToComplete and MarkReadyToComplete methods to + // safely modify the value of that field rather than accessing it through + // the embedded protobuf message directly. + m sync.Mutex + *tabletmanagerdatapb.OnlineDDL + // Stateful fields: - MigrationContext string `json:"context,omitempty"` - Status OnlineDDLStatus `json:"status,omitempty"` - TabletAlias string `json:"tablet,omitempty"` - Retries int64 `json:"retries,omitempty"` - ReadyToComplete int64 `json:"ready_to_complete,omitempty"` - WasReadyToComplete int64 `json:"was_ready_to_complete,omitempty"` + MigrationContext string `json:"context,omitempty" mapstructure:"context,omitempty"` + TabletAlias string `json:"tablet,omitempty" mapstructure:"tablet,omitempty"` } // FromJSON creates an OnlineDDL from json -func FromJSON(bytes []byte) (*OnlineDDL, error) { - onlineDDL := &OnlineDDL{} - err := json.Unmarshal(bytes, onlineDDL) - return onlineDDL, err +func FromJSON(data []byte) (*OnlineDDL, error) { + onlineDDL := &OnlineDDL{OnlineDDL: &tabletmanagerdatapb.OnlineDDL{}} + + m := map[string]any{} + if err := json.Unmarshal(data, &m); err != nil { + return onlineDDL, err + } + + camelcase := func(s string) string { + out := []string{} + for _, word := range strings.Split(s, "_") { + if len(word) == 0 { + out = append(out, word) + continue + } + + camelcased := strings.Join( + []string{strings.ToUpper(word[0:1]), word[1:]}, + "", + ) + out = append(out, camelcased) + } + + return strings.Join(out, "") + } + dec, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + DecodeHook: mapstructure.ComposeDecodeHookFunc( + hooks.DecodeReadyToComplete, + hooks.DecodeStatus, + hooks.DecodeStrategy, + hooks.DecodeWasReadyToComplete, + ), + Result: onlineDDL, + Squash: true, + MatchName: func(mapKey, fieldName string) bool { + switch mapKey { + case "tablet_alias", "migration_context", "ready_to_complete", "was_ready_to_complete": + if strings.EqualFold(mapKey, fieldName) { + return true + } else if strings.EqualFold(camelcase(mapKey), camelcase(fieldName)) { + log.Warningf("Use of legacy camel-cased field %s treated as %s. This will break in a future release.", fieldName, camelcase(mapKey)) + return true + } + } + + return strings.EqualFold(mapKey, fieldName) + }, + }) + if err != nil { + return onlineDDL, err + } + if err := dec.Decode(m); err != nil { + return onlineDDL, err + } + + if onlineDDL.TabletAlias != "" { + msg := "Parsed legacy field 'tablet', which has been replaced by 'tablet_alias'." + var err error + switch onlineDDL.OnlineDDL.TabletAlias { + case nil: + onlineDDL.OnlineDDL.TabletAlias, err = topoproto.ParseTabletAlias(onlineDDL.TabletAlias) + default: + msg += fmt.Sprintf(" 'tablet_alias' was also provided, so using %s instead.", topoproto.TabletAliasString(onlineDDL.OnlineDDL.TabletAlias)) + } + + if err != nil { + return onlineDDL, err + } + + log.Warningf(msg) + } + onlineDDL.TabletAlias = topoproto.TabletAliasString(onlineDDL.OnlineDDL.TabletAlias) + + if onlineDDL.MigrationContext != "" { + msg := "Parsed legacy field 'context', which has been replaced by 'migration_context'." + if onlineDDL.OnlineDDL.MigrationContext == "" { + onlineDDL.OnlineDDL.MigrationContext = onlineDDL.MigrationContext + } else { + msg += fmt.Sprintf(" 'migration_context' was also provided, so using %s instead.", onlineDDL.OnlineDDL.MigrationContext) + } + + log.Warningf(msg) + } + onlineDDL.MigrationContext = onlineDDL.OnlineDDL.MigrationContext + + return onlineDDL, nil +} + +// ParseOnlineDDLStatus parses the given status into the underlying enum type. +func ParseOnlineDDLStatus(name string) (tabletmanagerdatapb.OnlineDDL_Status, error) { + key := strings.ToUpper(name) + val, ok := tabletmanagerdatapb.OnlineDDL_Status_value[key] + if !ok { + return 0, fmt.Errorf("unknown enum name for OnlineDDL_Status: %s", name) + } + + if name != key { + log.Warningf("legacy status name %s parsed as %s. this will break in a future release.", name, key) + } + + return tabletmanagerdatapb.OnlineDDL_Status(val), nil +} + +func OnlineDDLStatusName(status tabletmanagerdatapb.OnlineDDL_Status) string { + return strings.ToLower(tabletmanagerdatapb.OnlineDDL_Status_name[int32(status)]) } // ParseOnlineDDLStatement parses the given SQL into a statement and returns the action type of the DDL statement, or error @@ -208,7 +300,7 @@ func NewOnlineDDL(keyspace string, table string, sql string, ddlStrategySetting encodeDirective(onlineDDLUUID), encodeDirective(migrationContext), encodeDirective(table), - encodeDirective(string(ddlStrategySetting.Strategy)), + encodeDirective(OnlineDDLStrategyName(ddlStrategySetting.Strategy)), encodeDirective(ddlStrategySetting.Options), )} if uuid, err := legacyParseRevertUUID(sql); err == nil { @@ -243,14 +335,16 @@ func NewOnlineDDL(keyspace string, table string, sql string, ddlStrategySetting } return &OnlineDDL{ - Keyspace: keyspace, - Table: table, - SQL: sql, - UUID: onlineDDLUUID, - Strategy: ddlStrategySetting.Strategy, - Options: ddlStrategySetting.Options, + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Keyspace: keyspace, + Table: table, + Sql: sql, + Uuid: onlineDDLUUID, + Strategy: ddlStrategySetting.Strategy, + Options: ddlStrategySetting.Options, + Status: tabletmanagerdatapb.OnlineDDL_REQUESTED, + }, MigrationContext: migrationContext, - Status: OnlineDDLStatusRequested, }, nil } @@ -295,19 +389,25 @@ func OnlineDDLFromCommentedStatement(stmt sqlparser.Statement) (onlineDDL *Onlin stmt.Format(buf) onlineDDL = &OnlineDDL{ - SQL: buf.String(), + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Sql: buf.String(), + }, } - if onlineDDL.UUID, err = decodeDirective("uuid"); err != nil { + if onlineDDL.Uuid, err = decodeDirective("uuid"); err != nil { return nil, err } - if !IsOnlineDDLUUID(onlineDDL.UUID) { + if !IsOnlineDDLUUID(onlineDDL.Uuid) { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "invalid UUID read from statement %s", sqlparser.String(stmt)) } if onlineDDL.Table, err = decodeDirective("table"); err != nil { return nil, err } if strategy, err := decodeDirective("strategy"); err == nil { - onlineDDL.Strategy = DDLStrategy(strategy) + if strategy, err := ParseDDLStrategyName(strategy); err == nil { + onlineDDL.Strategy = strategy + } else { + return nil, err + } } else { return nil, err } @@ -334,7 +434,7 @@ func (onlineDDL *OnlineDDL) ToJSON() ([]byte, error) { // sqlWithoutComments returns the SQL statement without comment directives. Useful for tests func (onlineDDL *OnlineDDL) sqlWithoutComments() (sql string, err error) { - sql = onlineDDL.SQL + sql = onlineDDL.Sql stmt, err := sqlparser.Parse(sql) if err != nil { // query validation and rebuilding @@ -364,13 +464,13 @@ func (onlineDDL *OnlineDDL) GetAction() (action sqlparser.DDLAction, err error) return sqlparser.RevertDDLAction, nil } - _, action, err = ParseOnlineDDLStatement(onlineDDL.SQL) + _, action, err = ParseOnlineDDLStatement(onlineDDL.Sql) return action, err } // IsView returns 'true' when the statement affects a VIEW func (onlineDDL *OnlineDDL) IsView() bool { - stmt, _, err := ParseOnlineDDLStatement(onlineDDL.SQL) + stmt, _, err := ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return false } @@ -381,6 +481,33 @@ func (onlineDDL *OnlineDDL) IsView() bool { return false } +// IsReady returns true if the given online DDL is ready to complete, as well as +// if it was _ever_ ready to complete. It is threadsafe. +// +// Do not attempt to access or modify the underlying fields directly; instead +// use this method and its companion MarkReady. +func (onlineDDL *OnlineDDL) IsReady() (isReady, wasReady bool) { + onlineDDL.m.Lock() + defer onlineDDL.m.Unlock() + + return onlineDDL.ReadyToComplete, onlineDDL.OnlineDDL.WasReadyToComplete +} + +// MarkReady marks the given online DDL as ready to complete. It is threadsafe. +// +// Do not attempt to access or modify the underlying field directly; instead +// use this method and its companion IsReady. +func (onlineDDL *OnlineDDL) MarkReady(isReady bool) { + onlineDDL.m.Lock() + defer onlineDDL.m.Unlock() + + if isReady { + onlineDDL.WasReadyToComplete = true // WasReadyToComplete is set once and never cleared + } + + onlineDDL.ReadyToComplete = isReady +} + // GetActionStr returns a string representation of the DDL action func (onlineDDL *OnlineDDL) GetActionStr() (action sqlparser.DDLAction, actionStr string, err error) { action, err = onlineDDL.GetAction() @@ -397,32 +524,32 @@ func (onlineDDL *OnlineDDL) GetActionStr() (action sqlparser.DDLAction, actionSt case sqlparser.DropDDLAction: return action, sqlparser.DropStr, nil } - return action, "", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "unsupported online DDL action. SQL=%s", onlineDDL.SQL) + return action, "", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "unsupported online DDL action. SQL=%s", onlineDDL.Sql) } // GetRevertUUID works when this migration is a revert for another migration. It returns the UUID // fo the reverted migration. // The function returns error when this is not a revert migration. func (onlineDDL *OnlineDDL) GetRevertUUID() (uuid string, err error) { - if uuid, err := legacyParseRevertUUID(onlineDDL.SQL); err == nil { + if uuid, err := legacyParseRevertUUID(onlineDDL.Sql); err == nil { return uuid, nil } - if stmt, err := sqlparser.Parse(onlineDDL.SQL); err == nil { + if stmt, err := sqlparser.Parse(onlineDDL.Sql); err == nil { if revert, ok := stmt.(*sqlparser.RevertMigration); ok { return revert.UUID, nil } } - return "", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "not a Revert DDL: '%s'", onlineDDL.SQL) + return "", vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "not a Revert DDL: '%s'", onlineDDL.Sql) } // ToString returns a simple string representation of this instance func (onlineDDL *OnlineDDL) ToString() string { - return fmt.Sprintf("OnlineDDL: keyspace=%s, table=%s, sql=%s", onlineDDL.Keyspace, onlineDDL.Table, onlineDDL.SQL) + return fmt.Sprintf("OnlineDDL: keyspace=%s, table=%s, sql=%s", onlineDDL.Keyspace, onlineDDL.Table, onlineDDL.Sql) } // GetGCUUID gets this OnlineDDL UUID in GC UUID format func (onlineDDL *OnlineDDL) GetGCUUID() string { - return OnlineDDLToGCUUID(onlineDDL.UUID) + return OnlineDDLToGCUUID(onlineDDL.Uuid) } // CreateOnlineDDLUUID creates a UUID in OnlineDDL format, e.g.: diff --git a/go/vt/schema/online_ddl_test.go b/go/vt/schema/online_ddl_test.go index c559c1e75f1..5c6de966842 100644 --- a/go/vt/schema/online_ddl_test.go +++ b/go/vt/schema/online_ddl_test.go @@ -25,7 +25,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "vitess.io/vitess/go/test/utils" "vitess.io/vitess/go/vt/sqlparser" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) func TestCreateUUID(t *testing.T) { @@ -55,7 +59,7 @@ func TestGetGCUUID(t *testing.T) { uuids := map[string]bool{} count := 20 for i := 0; i < count; i++ { - onlineDDL, err := NewOnlineDDL("ks", "tbl", "alter table t drop column c", NewDDLStrategySetting(DDLStrategyDirect, ""), "", "") + onlineDDL, err := NewOnlineDDL("ks", "tbl", "alter table t drop column c", NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_DIRECT, ""), "", "") assert.NoError(t, err) gcUUID := onlineDDL.GetGCUUID() assert.True(t, IsGCUUID(gcUUID)) @@ -88,7 +92,11 @@ func TestGetActionStr(t *testing.T) { } for _, ts := range tt { t.Run(ts.statement, func(t *testing.T) { - onlineDDL := &OnlineDDL{SQL: ts.statement} + onlineDDL := &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Sql: ts.statement, + }, + } _, actionStr, err := onlineDDL.GetActionStr() if ts.isError { assert.Error(t, err) @@ -149,7 +157,11 @@ func TestGetRevertUUID(t *testing.T) { } for _, ts := range tt { t.Run(ts.statement, func(t *testing.T) { - onlineDDL := &OnlineDDL{SQL: ts.statement} + onlineDDL := &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Sql: ts.statement, + }, + } uuid, err := onlineDDL.GetRevertUUID() if ts.isError { assert.Error(t, err) @@ -162,7 +174,7 @@ func TestGetRevertUUID(t *testing.T) { migrationContext := "354b-11eb-82cd-f875a4d24e90" for _, ts := range tt { t.Run(ts.statement, func(t *testing.T) { - onlineDDL, err := NewOnlineDDL("test_ks", "t", ts.statement, NewDDLStrategySetting(DDLStrategyOnline, ""), migrationContext, "") + onlineDDL, err := NewOnlineDDL("test_ks", "t", ts.statement, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_ONLINE, ""), migrationContext, "") assert.NoError(t, err) require.NotNil(t, onlineDDL) uuid, err := onlineDDL.GetRevertUUID() @@ -204,9 +216,9 @@ func TestNewOnlineDDL(t *testing.T) { }, } strategies := []*DDLStrategySetting{ - NewDDLStrategySetting(DDLStrategyDirect, ""), - NewDDLStrategySetting(DDLStrategyVitess, ""), - NewDDLStrategySetting(DDLStrategyOnline, "-singleton"), + NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_DIRECT, ""), + NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, ""), + NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_ONLINE, "-singleton"), } for _, ts := range tt { @@ -220,9 +232,9 @@ func TestNewOnlineDDL(t *testing.T) { } assert.NoError(t, err) // onlineDDL.SQL enriched with /*vt+ ... */ comment - assert.Contains(t, onlineDDL.SQL, hex.EncodeToString([]byte(onlineDDL.UUID))) - assert.Contains(t, onlineDDL.SQL, hex.EncodeToString([]byte(migrationContext))) - assert.Contains(t, onlineDDL.SQL, hex.EncodeToString([]byte(string(stgy.Strategy)))) + assert.Contains(t, onlineDDL.Sql, hex.EncodeToString([]byte(onlineDDL.Uuid))) + assert.Contains(t, onlineDDL.Sql, hex.EncodeToString([]byte(migrationContext))) + assert.Contains(t, onlineDDL.Sql, hex.EncodeToString([]byte(OnlineDDLStrategyName(stgy.Strategy)))) }) } }) @@ -232,18 +244,18 @@ func TestNewOnlineDDL(t *testing.T) { var err error var onlineDDL *OnlineDDL - onlineDDL, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(DDLStrategyVitess, ""), migrationContext, "") + onlineDDL, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, ""), migrationContext, "") assert.NoError(t, err) - assert.True(t, IsOnlineDDLUUID(onlineDDL.UUID)) + assert.True(t, IsOnlineDDLUUID(onlineDDL.Uuid)) - _, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(DDLStrategyOnline, ""), migrationContext, "abc") + _, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_ONLINE, ""), migrationContext, "abc") assert.Error(t, err) - onlineDDL, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(DDLStrategyVitess, ""), migrationContext, "4e5dcf80_354b_11eb_82cd_f875a4d24e90") + onlineDDL, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, ""), migrationContext, "4e5dcf80_354b_11eb_82cd_f875a4d24e90") assert.NoError(t, err) - assert.Equal(t, "4e5dcf80_354b_11eb_82cd_f875a4d24e90", onlineDDL.UUID) + assert.Equal(t, "4e5dcf80_354b_11eb_82cd_f875a4d24e90", onlineDDL.Uuid) - _, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(DDLStrategyVitess, ""), migrationContext, " 4e5dcf80_354b_11eb_82cd_f875a4d24e90") + _, err = NewOnlineDDL("test_ks", "t", "alter table t engine=innodb", NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, ""), migrationContext, " 4e5dcf80_354b_11eb_82cd_f875a4d24e90") assert.Error(t, err) }) } @@ -299,7 +311,7 @@ func TestNewOnlineDDLs(t *testing.T) { } assert.True(t, ok) - onlineDDLs, err := NewOnlineDDLs("test_ks", query, ddlStmt, NewDDLStrategySetting(DDLStrategyVitess, ""), migrationContext, "") + onlineDDLs, err := NewOnlineDDLs("test_ks", query, ddlStmt, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, ""), migrationContext, "") if expect.isError { assert.Error(t, err) assert.Contains(t, err.Error(), expect.expectErrorText) @@ -350,7 +362,7 @@ func TestNewOnlineDDLsForeignKeys(t *testing.T) { if allowForeignKeys { flags = "--unsafe-allow-foreign-keys" } - onlineDDLs, err := NewOnlineDDLs("test_ks", query, ddlStmt, NewDDLStrategySetting(DDLStrategyVitess, flags), migrationContext, "") + onlineDDLs, err := NewOnlineDDLs("test_ks", query, ddlStmt, NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_VITESS, flags), migrationContext, "") if allowForeignKeys { assert.NoError(t, err) } else { @@ -379,20 +391,20 @@ func TestOnlineDDLFromCommentedStatement(t *testing.T) { `alter view v as select * from t`, `revert vitess_migration '4e5dcf80_354b_11eb_82cd_f875a4d24e90'`, } - strategySetting := NewDDLStrategySetting(DDLStrategyGhost, `-singleton -declarative --max-load="Threads_running=5"`) + strategySetting := NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_GHOST, `-singleton -declarative --max-load="Threads_running=5"`) migrationContext := "354b-11eb-82cd-f875a4d24e90" for _, query := range queries { t.Run(query, func(t *testing.T) { o1, err := NewOnlineDDL("ks", "t", query, strategySetting, migrationContext, "") require.NoError(t, err) - stmt, err := sqlparser.Parse(o1.SQL) + stmt, err := sqlparser.Parse(o1.Sql) require.NoError(t, err) o2, err := OnlineDDLFromCommentedStatement(stmt) require.NoError(t, err) - assert.True(t, IsOnlineDDLUUID(o2.UUID)) - assert.Equal(t, o1.UUID, o2.UUID) + assert.True(t, IsOnlineDDLUUID(o2.Uuid)) + assert.Equal(t, o1.Uuid, o2.Uuid) assert.Equal(t, migrationContext, o2.MigrationContext) assert.Equal(t, "t", o2.Table) assert.Equal(t, strategySetting.Strategy, o2.Strategy) @@ -400,3 +412,330 @@ func TestOnlineDDLFromCommentedStatement(t *testing.T) { }) } } + +func TestFromJSON(t *testing.T) { + uuid, err := CreateUUIDWithDelimiter("_") + require.NoError(t, err, "failed to create UUID for tests") + + type testcase struct { + json string + expected *OnlineDDL + shouldErr bool + } + tests := []testcase{ + { + json: "{}", + expected: &OnlineDDL{OnlineDDL: &tabletmanagerdatapb.OnlineDDL{}}, + }, + { + // (andrew) TODO: expand this test case to contain all the struct + // fields. + json: fmt.Sprintf(`{ + "keyspace": "ks", + "table": "t1", + "schema": "CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY)", + "sql": "ALTER TABLE t1 ADD COLUMN i INT", + "uuid": "%s", + "strategy": "VITESS", + "options": "--allow-concurrent", + "retries": 2 + }`, uuid), + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Keyspace: "ks", + Table: "t1", + Schema: "CREATE TABLE t1 (id int(11) NOT NULL PRIMARY KEY)", + Sql: "ALTER TABLE t1 ADD COLUMN i INT", + Uuid: uuid, + Strategy: tabletmanagerdatapb.OnlineDDL_VITESS, + Options: "--allow-concurrent", + Retries: 2, + }, + }, + }, + } + + for _, test := range tests { + test := test + + t.Run("", func(t *testing.T) { + actual, err := FromJSON([]byte(test.json)) + if test.shouldErr { + assert.Error(t, err) + return + } + + require.NoError(t, err) + utils.MustMatch(t, test.expected, actual) + }) + } + + t.Run("strategy parsing", func(t *testing.T) { + tests := []testcase{ + { + json: `{"strategy": "pt-osc"}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Strategy: tabletmanagerdatapb.OnlineDDL_PTOSC, + }, + }, + }, + { + json: `{"strategy": "GHOST"}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Strategy: tabletmanagerdatapb.OnlineDDL_GHOST, + }, + }, + }, + { + json: `{"strategy": 3}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Strategy: tabletmanagerdatapb.OnlineDDL_DIRECT, + }, + }, + }, + { + json: `{"strategy": "not a strategy"}`, + shouldErr: true, + }, + } + + for _, test := range tests { + test := test + + t.Run("", func(t *testing.T) { + actual, err := FromJSON([]byte(test.json)) + if test.shouldErr { + assert.Error(t, err) + return + } + + require.NoError(t, err) + utils.MustMatch(t, test.expected, actual) + }) + } + }) + + t.Run("tablet alias parsing", func(t *testing.T) { + tests := []testcase{ + { + json: `{"tablet": "zone1-101"}`, + expected: &OnlineDDL{ + TabletAlias: "zone1-101", + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + TabletAlias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + }, + { + json: `{ + "tablet_alias": { + "cell": "zone1", + "uid": 101 + } + }`, + expected: &OnlineDDL{ + TabletAlias: "zone1-101", + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + TabletAlias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + }, + { + json: `{ + "tablet": "zone1-404", + "tablet_alias": { + "cell": "zone1", + "uid": 101 + } + }`, + expected: &OnlineDDL{ + TabletAlias: "zone1-101", + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + TabletAlias: &topodatapb.TabletAlias{ + Cell: "zone1", + Uid: 101, + }, + }, + }, + }, + } + + for _, test := range tests { + test := test + + t.Run("", func(t *testing.T) { + actual, err := FromJSON([]byte(test.json)) + if test.shouldErr { + assert.Error(t, err) + return + } + + require.NoError(t, err) + utils.MustMatch(t, test.expected, actual) + }) + } + }) + + t.Run("context parsing", func(t *testing.T) { + tests := []testcase{ + { + json: `{"context": "abc123"}`, + expected: &OnlineDDL{ + MigrationContext: "abc123", + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + MigrationContext: "abc123", + }, + }, + }, + { + json: `{"migration_context": "abc123"}`, + expected: &OnlineDDL{ + MigrationContext: "abc123", + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + MigrationContext: "abc123", + }, + }, + }, + { + json: `{ + "context": "abc123", + "migration_context": "def456" + }`, + expected: &OnlineDDL{ + MigrationContext: "def456", + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + MigrationContext: "def456", + }, + }, + }, + } + + for _, test := range tests { + test := test + + t.Run("", func(t *testing.T) { + actual, err := FromJSON([]byte(test.json)) + if test.shouldErr { + assert.Error(t, err) + return + } + + require.NoError(t, err) + utils.MustMatch(t, test.expected, actual) + }) + } + }) + + t.Run("ready_to_complete parsing", func(t *testing.T) { + tests := []testcase{ + { + json: `{"ready_to_complete": true}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + ReadyToComplete: true, + }, + }, + }, + { + json: `{"ready_to_complete": 1}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + ReadyToComplete: true, + }, + }, + }, + { + json: `{"ready_to_complete": false}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + ReadyToComplete: false, + }, + }, + }, + { + json: `{"ready_to_complete": 0}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + ReadyToComplete: false, + }, + }, + }, + } + + for _, test := range tests { + test := test + + t.Run("", func(t *testing.T) { + actual, err := FromJSON([]byte(test.json)) + if test.shouldErr { + assert.Error(t, err) + return + } + + require.NoError(t, err) + utils.MustMatch(t, test.expected, actual) + }) + } + }) + + t.Run("was_ready_to_complete parsing", func(t *testing.T) { + tests := []testcase{ + { + json: `{"was_ready_to_complete": true}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + WasReadyToComplete: true, + }, + }, + }, + { + json: `{"was_ready_to_complete": 1}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + WasReadyToComplete: true, + }, + }, + }, + { + json: `{"was_ready_to_complete": false}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + WasReadyToComplete: false, + }, + }, + }, + { + json: `{"was_ready_to_complete": 0}`, + expected: &OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + WasReadyToComplete: false, + }, + }, + }, + } + + for _, test := range tests { + test := test + + t.Run("", func(t *testing.T) { + actual, err := FromJSON([]byte(test.json)) + if test.shouldErr { + assert.Error(t, err) + return + } + + require.NoError(t, err) + utils.MustMatch(t, test.expected, actual) + }) + } + }) +} diff --git a/go/vt/schemamanager/tablet_executor.go b/go/vt/schemamanager/tablet_executor.go index 285680a3e80..88bec68ae25 100644 --- a/go/vt/schemamanager/tablet_executor.go +++ b/go/vt/schemamanager/tablet_executor.go @@ -168,7 +168,7 @@ func (exec *TabletExecutor) isOnlineSchemaDDL(stmt sqlparser.Statement) (isOnlin if exec.ddlStrategySetting == nil { return false } - if exec.ddlStrategySetting.Strategy.IsDirect() { + if exec.ddlStrategySetting.IsDirect() { return false } switch stmt.GetAction() { @@ -197,24 +197,24 @@ func (exec *TabletExecutor) executeSQL(ctx context.Context, sql string, provided return false, err } for _, onlineDDL := range onlineDDLs { - exec.executeOnAllTablets(ctx, execResult, onlineDDL.SQL, true) + exec.executeOnAllTablets(ctx, execResult, onlineDDL.Sql, true) if len(execResult.SuccessShards) > 0 { - execResult.UUIDs = append(execResult.UUIDs, onlineDDL.UUID) - exec.logger.Printf("%s\n", onlineDDL.UUID) + execResult.UUIDs = append(execResult.UUIDs, onlineDDL.Uuid) + exec.logger.Printf("%s\n", onlineDDL.Uuid) } } return true, nil } case *sqlparser.RevertMigration: - strategySetting := schema.NewDDLStrategySetting(schema.DDLStrategyOnline, exec.ddlStrategySetting.Options) + strategySetting := schema.NewDDLStrategySetting(tabletmanagerdatapb.OnlineDDL_ONLINE, exec.ddlStrategySetting.Options) onlineDDL, err := schema.NewOnlineDDL(exec.keyspace, "", sqlparser.String(stmt), strategySetting, exec.migrationContext, providedUUID) if err != nil { execResult.ExecutorErr = err.Error() return false, err } - exec.executeOnAllTablets(ctx, execResult, onlineDDL.SQL, true) - execResult.UUIDs = append(execResult.UUIDs, onlineDDL.UUID) - exec.logger.Printf("%s\n", onlineDDL.UUID) + exec.executeOnAllTablets(ctx, execResult, onlineDDL.Sql, true) + execResult.UUIDs = append(execResult.UUIDs, onlineDDL.Uuid) + exec.logger.Printf("%s\n", onlineDDL.Uuid) return true, nil case *sqlparser.AlterMigration: exec.executeOnAllTablets(ctx, execResult, sql, true) diff --git a/go/vt/schemamanager/tablet_executor_test.go b/go/vt/schemamanager/tablet_executor_test.go index f11c1c68917..987fd53a31d 100644 --- a/go/vt/schemamanager/tablet_executor_test.go +++ b/go/vt/schemamanager/tablet_executor_test.go @@ -30,7 +30,6 @@ import ( "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl/tmutils" tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" - "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" ) @@ -207,7 +206,7 @@ func TestIsOnlineSchemaDDL(t *testing.T) { query string ddlStrategy string isOnlineDDL bool - strategy schema.DDLStrategy + strategy tabletmanagerdatapb.OnlineDDL_Strategy options string }{ { @@ -218,19 +217,19 @@ func TestIsOnlineSchemaDDL(t *testing.T) { query: "CREATE TABLE t(id int)", ddlStrategy: "gh-ost", isOnlineDDL: true, - strategy: schema.DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, }, { query: "ALTER TABLE t ADD COLUMN i INT", ddlStrategy: "online", isOnlineDDL: true, - strategy: schema.DDLStrategyOnline, + strategy: tabletmanagerdatapb.OnlineDDL_ONLINE, }, { query: "ALTER TABLE t ADD COLUMN i INT", ddlStrategy: "vitess", isOnlineDDL: true, - strategy: schema.DDLStrategyVitess, + strategy: tabletmanagerdatapb.OnlineDDL_VITESS, }, { query: "ALTER TABLE t ADD COLUMN i INT", @@ -241,13 +240,13 @@ func TestIsOnlineSchemaDDL(t *testing.T) { query: "ALTER TABLE t ADD COLUMN i INT", ddlStrategy: "gh-ost", isOnlineDDL: true, - strategy: schema.DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, }, { query: "ALTER TABLE t ADD COLUMN i INT", ddlStrategy: "gh-ost --max-load=Threads_running=100", isOnlineDDL: true, - strategy: schema.DDLStrategyGhost, + strategy: tabletmanagerdatapb.OnlineDDL_GHOST, options: "--max-load=Threads_running=100", }, { diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 9aec6995fdf..c5842b4d3bf 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -2878,7 +2878,7 @@ func commandApplySchema(ctx context.Context, wr *wrangler.Wrangler, subFlags *pf subFlags.MarkDeprecated("allow_long_unavailability", "") sql := subFlags.String("sql", "", "A list of semicolon-delimited SQL commands") sqlFile := subFlags.String("sql-file", "", "Identifies the file that contains the SQL commands") - ddlStrategy := subFlags.String("ddl_strategy", string(schema.DDLStrategyDirect), "Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'") + ddlStrategy := subFlags.String("ddl_strategy", strings.ToLower(tabletmanagerdatapb.OnlineDDL_Strategy_name[int32(tabletmanagerdatapb.OnlineDDL_DIRECT)]), "Online DDL strategy, compatible with @@ddl_strategy session variable (examples: 'gh-ost', 'pt-osc', 'gh-ost --max-load=Threads_running=100'") uuidList := subFlags.String("uuid_list", "", "Optional: comma delimited explicit UUIDs for migration. If given, must match number of DDL changes") migrationContext := subFlags.String("migration_context", "", "For Online DDL, optionally supply a custom unique string used as context for the migration(s) in this command. By default a unique context is auto-generated by Vitess") requestContext := subFlags.String("request_context", "", "synonym for --migration_context") @@ -3004,20 +3004,17 @@ func commandOnlineDDL(ctx context.Context, wr *wrangler.Wrangler, subFlags *pfla condition = "migration_uuid like '%'" case "recent": condition = "requested_timestamp > now() - interval 1 week" - case - string(schema.OnlineDDLStatusCancelled), - string(schema.OnlineDDLStatusQueued), - string(schema.OnlineDDLStatusReady), - string(schema.OnlineDDLStatusRunning), - string(schema.OnlineDDLStatusComplete), - string(schema.OnlineDDLStatusFailed): - condition, err = sqlparser.ParseAndBind("migration_status=%a", sqltypes.StringBindVariable(arg)) default: - if schema.IsOnlineDDLUUID(arg) { - condition, err = sqlparser.ParseAndBind("migration_uuid=%a", sqltypes.StringBindVariable(arg)) + var bindErr error + if _, err := schema.ParseOnlineDDLStatus(arg); err == nil { + // Argument is a status name. + condition, bindErr = sqlparser.ParseAndBind("migration_status=%a", sqltypes.StringBindVariable(arg)) + } else if schema.IsOnlineDDLUUID(arg) { + condition, bindErr = sqlparser.ParseAndBind("migration_uuid=%a", sqltypes.StringBindVariable(arg)) } else { - condition, err = sqlparser.ParseAndBind("migration_context=%a", sqltypes.StringBindVariable(arg)) + condition, bindErr = sqlparser.ParseAndBind("migration_context=%a", sqltypes.StringBindVariable(arg)) } + err = bindErr } order := " order by `id` " switch *orderBy { diff --git a/go/vt/vtgate/engine/ddl.go b/go/vt/vtgate/engine/ddl.go index d0ac2cb457e..8dc46f8e651 100644 --- a/go/vt/vtgate/engine/ddl.go +++ b/go/vt/vtgate/engine/ddl.go @@ -82,7 +82,7 @@ func (ddl *DDL) GetTableName() string { func (ddl *DDL) isOnlineSchemaDDL() bool { switch ddl.DDL.GetAction() { case sqlparser.CreateDDLAction, sqlparser.DropDDLAction, sqlparser.AlterDDLAction: - return !ddl.OnlineDDL.DDLStrategySetting.Strategy.IsDirect() + return !ddl.OnlineDDL.DDLStrategySetting.IsDirect() } return false } diff --git a/go/vt/vtgate/engine/online_ddl.go b/go/vt/vtgate/engine/online_ddl.go index 215b8d9be5f..ad784706ba7 100644 --- a/go/vt/vtgate/engine/online_ddl.go +++ b/go/vt/vtgate/engine/online_ddl.go @@ -95,7 +95,7 @@ func (v *OnlineDDL) TryExecute(ctx context.Context, vcursor VCursor, bindVars ma s := Send{ Keyspace: v.Keyspace, TargetDestination: v.TargetDestination, - Query: onlineDDL.SQL, + Query: onlineDDL.Sql, IsDML: false, SingleShardOnly: false, } @@ -103,7 +103,7 @@ func (v *OnlineDDL) TryExecute(ctx context.Context, vcursor VCursor, bindVars ma return result, err } result.Rows = append(result.Rows, []sqltypes.Value{ - sqltypes.NewVarChar(onlineDDL.UUID), + sqltypes.NewVarChar(onlineDDL.Uuid), }) } return result, err diff --git a/go/vt/vtgate/engine/revert_migration.go b/go/vt/vtgate/engine/revert_migration.go index e7237d01da4..66c3c6db02e 100644 --- a/go/vt/vtgate/engine/revert_migration.go +++ b/go/vt/vtgate/engine/revert_migration.go @@ -22,12 +22,14 @@ import ( "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/key" - querypb "vitess.io/vitess/go/vt/proto/query" - vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/vindexes" + + querypb "vitess.io/vitess/go/vt/proto/query" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) var _ Primitive = (*RevertMigration)(nil) @@ -87,7 +89,7 @@ func (v *RevertMigration) TryExecute(ctx context.Context, vcursor VCursor, bindV if err != nil { return nil, err } - ddlStrategySetting.Strategy = schema.DDLStrategyOnline // and we keep the options as they were + ddlStrategySetting.Strategy = tabletmanagerdatapb.OnlineDDL_ONLINE // and we keep the options as they were onlineDDL, err := schema.NewOnlineDDL(v.GetKeyspaceName(), "", sql, ddlStrategySetting, fmt.Sprintf("vtgate:%s", vcursor.Session().GetSessionUUID()), "") if err != nil { return result, err @@ -96,7 +98,7 @@ func (v *RevertMigration) TryExecute(ctx context.Context, vcursor VCursor, bindV s := Send{ Keyspace: v.Keyspace, TargetDestination: v.TargetDestination, - Query: onlineDDL.SQL, + Query: onlineDDL.Sql, IsDML: false, SingleShardOnly: false, } @@ -104,7 +106,7 @@ func (v *RevertMigration) TryExecute(ctx context.Context, vcursor VCursor, bindV return result, err } result.Rows = append(result.Rows, []sqltypes.Value{ - sqltypes.NewVarChar(onlineDDL.UUID), + sqltypes.NewVarChar(onlineDDL.Uuid), }) return result, err } diff --git a/go/vt/vtgate/vtgate.go b/go/vt/vtgate/vtgate.go index eef9c11a061..6a6818392c8 100644 --- a/go/vt/vtgate/vtgate.go +++ b/go/vt/vtgate/vtgate.go @@ -41,6 +41,7 @@ import ( "vitess.io/vitess/go/vt/logutil" binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" querypb "vitess.io/vitess/go/vt/proto/query" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" topodatapb "vitess.io/vitess/go/vt/proto/topodata" vtgatepb "vitess.io/vitess/go/vt/proto/vtgate" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" @@ -93,7 +94,7 @@ var ( // ddl related flags foreignKeyMode = "allow" dbDDLPlugin = "fail" - defaultDDLStrategy = string(schema.DDLStrategyDirect) + defaultDDLStrategy = strings.ToLower(tabletmanagerdatapb.OnlineDDL_Strategy_name[int32(tabletmanagerdatapb.OnlineDDL_DIRECT)]) enableOnlineDDL = true enableDirectDDL = true diff --git a/go/vt/vttablet/onlineddl/analysis.go b/go/vt/vttablet/onlineddl/analysis.go index 040f79d861e..ac397b945fc 100644 --- a/go/vt/vttablet/onlineddl/analysis.go +++ b/go/vt/vttablet/onlineddl/analysis.go @@ -348,7 +348,7 @@ func AnalyzeInstantDDL(alterTable *sqlparser.AlterTable, createTable *sqlparser. // analyzeSpecialAlterPlan checks if the given ALTER onlineDDL, and for the current state of affected table, // can be executed in a special way. If so, it returns with a "special plan" func (e *Executor) analyzeSpecialAlterPlan(ctx context.Context, onlineDDL *schema.OnlineDDL, capableOf mysql.CapableOf) (*SpecialAlterPlan, error) { - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return nil, err } @@ -360,7 +360,7 @@ func (e *Executor) analyzeSpecialAlterPlan(ctx context.Context, onlineDDL *schem createTable, err := e.getCreateTableStatement(ctx, onlineDDL.Table) if err != nil { - return nil, vterrors.Wrapf(err, "in Executor.analyzeSpecialAlterPlan(), uuid=%v, table=%v", onlineDDL.UUID, onlineDDL.Table) + return nil, vterrors.Wrapf(err, "in Executor.analyzeSpecialAlterPlan(), uuid=%v, table=%v", onlineDDL.Uuid, onlineDDL.Table) } // special plans which support reverts are trivially desired: diff --git a/go/vt/vttablet/onlineddl/executor.go b/go/vt/vttablet/onlineddl/executor.go index 244aa8ce8b2..b002625a2de 100644 --- a/go/vt/vttablet/onlineddl/executor.go +++ b/go/vt/vttablet/onlineddl/executor.go @@ -35,10 +35,8 @@ import ( "time" "github.com/spf13/pflag" - - "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" "vitess.io/vitess/go/mysql" "vitess.io/vitess/go/sqlescape" @@ -48,10 +46,6 @@ import ( "vitess.io/vitess/go/vt/binlog/binlogplayer" "vitess.io/vitess/go/vt/dbconnpool" "vitess.io/vitess/go/vt/log" - binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" - querypb "vitess.io/vitess/go/vt/proto/query" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" - vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/schemadiff" "vitess.io/vitess/go/vt/servenv" @@ -65,6 +59,12 @@ import ( "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle" "vitess.io/vitess/go/vt/vttablet/tabletserver/throttle/throttlerapp" "vitess.io/vitess/go/vt/vttablet/tmclient" + + binlogdatapb "vitess.io/vitess/go/vt/proto/binlogdata" + querypb "vitess.io/vitess/go/vt/proto/query" + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" + vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) var ( @@ -412,7 +412,7 @@ func (e *Executor) allowConcurrentMigration(onlineDDL *schema.OnlineDDL) (action case sqlparser.AlterDDLAction: // ALTER is only allowed concurrent execution if this is a Vitess migration strategy := onlineDDL.StrategySetting().Strategy - return action, (strategy == schema.DDLStrategyOnline || strategy == schema.DDLStrategyVitess) + return action, (strategy == tabletmanagerdatapb.OnlineDDL_ONLINE || strategy == tabletmanagerdatapb.OnlineDDL_VITESS) case sqlparser.RevertDDLAction: // REVERT is allowed to run concurrently. // Reminder that REVERT is supported for CREATE, DROP and for 'vitess' ALTER, but never for @@ -438,9 +438,8 @@ func (e *Executor) proposedMigrationConflictsWithRunningMigration(runningMigrati // Specifically, if the running migration is an ALTER, and is still busy with copying rows (copy_state), then // we consider the two to be conflicting. But, if the running migration is done copying rows, and is now only // applying binary logs, and is up-to-date, then we consider a new ALTER migration to be non-conflicting. - if atomic.LoadInt64(&runningMigration.WasReadyToComplete) == 0 { - return true - } + _ /*isReady*/, wasReady := runningMigration.IsReady() + return !wasReady } return false } @@ -615,7 +614,7 @@ func (e *Executor) parseAlterOptions(ctx context.Context, onlineDDL *schema.Onli // and because we don't want gh-ost to know about WITH_GHOST and WITH_PT syntax, // we resort to regexp-based parsing of the query. // TODO(shlomi): generate _alter options_ via sqlparser when it full supports ALTER TABLE syntax. - _, _, alterOptions := schema.ParseAlterTableOptions(onlineDDL.SQL) + _, _, alterOptions := schema.ParseAlterTableOptions(onlineDDL.Sql) return alterOptions } @@ -633,8 +632,8 @@ func (e *Executor) executeDirectly(ctx context.Context, onlineDDL *schema.Online return false, err } - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusRunning, false, progressPctStarted, etaSecondsUnknown, rowsCopiedUnknown, emptyHint) - _, err = conn.ExecuteFetch(onlineDDL.SQL, 0, false) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_RUNNING, false, progressPctStarted, etaSecondsUnknown, rowsCopiedUnknown, emptyHint) + _, err = conn.ExecuteFetch(onlineDDL.Sql, 0, false) if err != nil { // let's see if this error is actually acceptable @@ -653,7 +652,7 @@ func (e *Executor) executeDirectly(ctx context.Context, onlineDDL *schema.Online return false, err } defer e.reloadSchema(ctx) - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) return acceptableErrorCodeFound, nil } @@ -781,7 +780,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er return err } isVreplicationTestSuite := onlineDDL.StrategySetting().IsVreplicationTestSuite() - e.updateMigrationStage(ctx, onlineDDL.UUID, "starting cut-over") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "starting cut-over") var sentryTableName string @@ -812,7 +811,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er // We create the sentry table before toggling writes, because this involves a WaitForPos, which takes some time. We // don't want to overload the buffering time with this excessive wait. - if err := e.updateArtifacts(ctx, onlineDDL.UUID, sentryTableName); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, sentryTableName); err != nil { return err } @@ -829,7 +828,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er // removing the entry _, err := e.execQuery(ctx, dropSentryTableQuery.Query) if err == nil { - e.clearSingleArtifact(ctx, onlineDDL.UUID, sentryTableName) + e.clearSingleArtifact(ctx, onlineDDL.Uuid, sentryTableName) } // This was a best effort optimization. Possibly the error is not nil. Which means we // still have a record of the sentry table, and gcArtifacts() will still be able to take @@ -839,17 +838,17 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er if _, err := e.execQuery(ctx, parsed.Query); err != nil { return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "sentry table created: %s", sentryTableName) + e.updateMigrationStage(ctx, onlineDDL.Uuid, "sentry table created: %s", sentryTableName) postSentryPos, err := e.primaryPosition(ctx) if err != nil { return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "waiting for post-sentry pos: %v", mysql.EncodePosition(postSentryPos)) + e.updateMigrationStage(ctx, onlineDDL.Uuid, "waiting for post-sentry pos: %v", mysql.EncodePosition(postSentryPos)) if err := waitForPos(s, postSentryPos); err != nil { return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "post-sentry pos reached") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "post-sentry pos reached") } lockConn, err := e.pool.Get(ctx, nil) @@ -906,7 +905,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er defer bufferingContextCancel() // Preparation is complete. We proceed to cut-over. toggleBuffering := func(bufferQueries bool) error { - log.Infof("toggling buffering: %t in migration %v", bufferQueries, onlineDDL.UUID) + log.Infof("toggling buffering: %t in migration %v", bufferQueries, onlineDDL.Uuid) timeout := migrationCutOverThreshold + qrBufferExtraTimeout e.toggleBufferTableFunc(bufferingCtx, onlineDDL.Table, timeout, bufferQueries) @@ -919,19 +918,19 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er return err } } - log.Infof("toggled buffering: %t in migration %v", bufferQueries, onlineDDL.UUID) + log.Infof("toggled buffering: %t in migration %v", bufferQueries, onlineDDL.Uuid) return nil } var reenableOnce sync.Once reenableWritesOnce := func() { reenableOnce.Do(func() { - log.Infof("re-enabling writes in migration %v", onlineDDL.UUID) + log.Infof("re-enabling writes in migration %v", onlineDDL.Uuid) toggleBuffering(false) go log.Infof("cutOverVReplMigration %v: unbuffered queries", s.workflow) }) } - e.updateMigrationStage(ctx, onlineDDL.UUID, "buffering queries") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "buffering queries") // stop writes on source: err = toggleBuffering(true) defer reenableWritesOnce() @@ -942,7 +941,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er // query executor, it passed the ACLs and is _about to_ execute. This will be nicer to those queries: // they will be able to complete before the rename, rather than block briefly on the rename only to find // the table no longer exists. - e.updateMigrationStage(ctx, onlineDDL.UUID, "graceful wait for buffering") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "graceful wait for buffering") time.Sleep(100 * time.Millisecond) if isVreplicationTestSuite { @@ -955,11 +954,11 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er if _, err := e.execQuery(ctx, parsed.Query); err != nil { return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "test suite 'before' table renamed") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "test suite 'before' table renamed") } else { // real production - e.updateMigrationStage(ctx, onlineDDL.UUID, "locking tables") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "locking tables") lockCtx, cancel := context.WithTimeout(ctx, migrationCutOverThreshold) defer cancel() lockTableQuery := sqlparser.BuildParsedQuery(sqlLockTwoTablesWrite, sentryTableName, onlineDDL.Table) @@ -967,20 +966,20 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "renaming tables") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "renaming tables") go func() { _, err := renameConn.Exec(ctx, renameQuery.Query, 1, false) renameCompleteChan <- err }() // the rename should block, because of the LOCK. Wait for it to show up. - e.updateMigrationStage(ctx, onlineDDL.UUID, "waiting for RENAME to block") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "waiting for RENAME to block") if err := waitForRenameProcess(); err != nil { return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "RENAME found") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "RENAME found") } - e.updateMigrationStage(ctx, onlineDDL.UUID, "reading post-lock pos") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "reading post-lock pos") postWritesPos, err := e.primaryPosition(ctx) if err != nil { return err @@ -998,14 +997,14 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "waiting for post-lock pos: %v", mysql.EncodePosition(postWritesPos)) + e.updateMigrationStage(ctx, onlineDDL.Uuid, "waiting for post-lock pos: %v", mysql.EncodePosition(postWritesPos)) if err := waitForPos(s, postWritesPos); err != nil { - e.updateMigrationStage(ctx, onlineDDL.UUID, "timeout while waiting for post-lock pos: %v", err) + e.updateMigrationStage(ctx, onlineDDL.Uuid, "timeout while waiting for post-lock pos: %v", err) return err } go log.Infof("cutOverVReplMigration %v: done waiting for position %v", s.workflow, mysql.EncodePosition(postWritesPos)) // Stop vreplication - e.updateMigrationStage(ctx, onlineDDL.UUID, "stopping vreplication") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "stopping vreplication") if _, err := e.vreplicationExec(ctx, tablet.Tablet, binlogplayer.StopVReplication(s.id, "stopped for online DDL cutover")); err != nil { return err } @@ -1020,15 +1019,15 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er if _, err := e.execQuery(ctx, parsed.Query); err != nil { return err } - e.updateMigrationStage(ctx, onlineDDL.UUID, "test suite 'after' table renamed") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "test suite 'after' table renamed") } else { - e.updateMigrationStage(ctx, onlineDDL.UUID, "validating rename is still in place") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "validating rename is still in place") if err := waitForRenameProcess(); err != nil { return err } // Normal (non-testing) alter table - e.updateMigrationStage(ctx, onlineDDL.UUID, "dropping sentry table") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "dropping sentry table") { dropTableQuery := sqlparser.BuildParsedQuery(sqlDropTable, sentryTableName) @@ -1041,7 +1040,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er { lockCtx, cancel := context.WithTimeout(ctx, migrationCutOverThreshold) defer cancel() - e.updateMigrationStage(ctx, onlineDDL.UUID, "unlocking tables") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "unlocking tables") if _, err := lockConn.Exec(lockCtx, sqlUnlockTables, 1, false); err != nil { return err } @@ -1049,7 +1048,7 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er { lockCtx, cancel := context.WithTimeout(ctx, migrationCutOverThreshold) defer cancel() - e.updateMigrationStage(lockCtx, onlineDDL.UUID, "waiting for RENAME to complete") + e.updateMigrationStage(lockCtx, onlineDDL.Uuid, "waiting for RENAME to complete") if err := <-renameCompleteChan; err != nil { return err } @@ -1057,8 +1056,8 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er } } } - e.updateMigrationStage(ctx, onlineDDL.UUID, "cut-over complete") - e.ownedRunningMigrations.Delete(onlineDDL.UUID) + e.updateMigrationStage(ctx, onlineDDL.Uuid, "cut-over complete") + e.ownedRunningMigrations.Delete(onlineDDL.Uuid) go func() { // Tables are swapped! Let's take the opportunity to ReloadSchema now @@ -1067,15 +1066,15 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er // this means ReloadSchema is not in sync with the actual schema change. Users will still need to run tracker if they want to sync. // In the future, we will want to reload the single table, instead of reloading the schema. if err := e.reloadSchema(ctx); err != nil { - vterrors.Errorf(vtrpcpb.Code_UNKNOWN, "Error on ReloadSchema while cutting over vreplication migration UUID: %+v", onlineDDL.UUID) + vterrors.Errorf(vtrpcpb.Code_UNKNOWN, "Error on ReloadSchema while cutting over vreplication migration UUID: %+v", onlineDDL.Uuid) } }() // Tables are now swapped! Migration is successful - e.updateMigrationStage(ctx, onlineDDL.UUID, "re-enabling writes") + e.updateMigrationStage(ctx, onlineDDL.Uuid, "re-enabling writes") reenableWritesOnce() // this function is also deferred, in case of early return; but now would be a good time to resume writes, before we publish the migration as "complete" go log.Infof("cutOverVReplMigration %v: marking as complete", s.workflow) - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, s.rowsCopied, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, s.rowsCopied, emptyHint) return nil // deferred function will re-enable writes now @@ -1136,9 +1135,9 @@ func (e *Executor) initMigrationSQLMode(ctx context.Context, onlineDDL *schema.O func (e *Executor) newConstraintName(onlineDDL *schema.OnlineDDL, constraintType ConstraintType, hashExists map[string]bool, seed string, oldName string) string { constraintIndicator := constraintIndicatorMap[int(constraintType)] oldName = schemadiff.ExtractConstraintOriginalName(onlineDDL.Table, oldName) - hash := textutil.UUIDv5Base36(onlineDDL.UUID, onlineDDL.Table, seed) + hash := textutil.UUIDv5Base36(onlineDDL.Uuid, onlineDDL.Table, seed) for i := 1; hashExists[hash]; i++ { - hash = textutil.UUIDv5Base36(onlineDDL.UUID, onlineDDL.Table, seed, fmt.Sprintf("%d", i)) + hash = textutil.UUIDv5Base36(onlineDDL.Uuid, onlineDDL.Table, seed, fmt.Sprintf("%d", i)) } hashExists[hash] = true suffix := "_" + hash @@ -1285,8 +1284,8 @@ func (e *Executor) initVreplicationOriginalMigration(ctx context.Context, online return v, err } - vreplTableName := fmt.Sprintf("_%s_%s_vrepl", onlineDDL.UUID, ReadableTimestamp()) - if err := e.updateArtifacts(ctx, onlineDDL.UUID, vreplTableName); err != nil { + vreplTableName := fmt.Sprintf("_%s_%s_vrepl", onlineDDL.Uuid, ReadableTimestamp()) + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, vreplTableName); err != nil { return v, err } constraintMap, err := e.createTableLike(ctx, vreplTableName, onlineDDL, conn) @@ -1294,7 +1293,7 @@ func (e *Executor) initVreplicationOriginalMigration(ctx context.Context, online return nil, err } { - stmt, err := sqlparser.ParseStrictDDL(onlineDDL.SQL) + stmt, err := sqlparser.ParseStrictDDL(onlineDDL.Sql) if err != nil { return nil, err } @@ -1316,7 +1315,7 @@ func (e *Executor) initVreplicationOriginalMigration(ctx context.Context, online } } } - v = NewVRepl(onlineDDL.UUID, e.keyspace, e.shard, e.dbName, onlineDDL.Table, vreplTableName, onlineDDL.SQL, onlineDDL.StrategySetting().IsAnalyzeTableFlag()) + v = NewVRepl(onlineDDL.Uuid, e.keyspace, e.shard, e.dbName, onlineDDL.Table, vreplTableName, onlineDDL.Sql, onlineDDL.StrategySetting().IsAnalyzeTableFlag()) return v, nil } @@ -1351,14 +1350,14 @@ func (e *Executor) initVreplicationRevertMigration(ctx context.Context, onlineDD // Getting here we've already validated that migration is revertible // Validation: vreplication still exists for reverted migration - revertStream, err := e.readVReplStream(ctx, revertMigration.UUID, false) + revertStream, err := e.readVReplStream(ctx, revertMigration.Uuid, false) if err != nil { // cannot read the vreplication stream which we want to revert - return nil, fmt.Errorf("can not revert vreplication migration %s because vreplication stream %s was not found", revertMigration.UUID, revertMigration.UUID) + return nil, fmt.Errorf("can not revert vreplication migration %s because vreplication stream %s was not found", revertMigration.Uuid, revertMigration.Uuid) } onlineDDL.Table = revertMigration.Table - if err := e.updateMySQLTable(ctx, onlineDDL.UUID, onlineDDL.Table); err != nil { + if err := e.updateMySQLTable(ctx, onlineDDL.Uuid, onlineDDL.Table); err != nil { return nil, err } @@ -1367,10 +1366,10 @@ func (e *Executor) initVreplicationRevertMigration(ctx context.Context, onlineDD return nil, err } - if err := e.updateArtifacts(ctx, onlineDDL.UUID, vreplTableName); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, vreplTableName); err != nil { return v, err } - v = NewVRepl(onlineDDL.UUID, e.keyspace, e.shard, e.dbName, onlineDDL.Table, vreplTableName, "", false) + v = NewVRepl(onlineDDL.Uuid, e.keyspace, e.shard, e.dbName, onlineDDL.Table, vreplTableName, "", false) v.pos = revertStream.pos return v, nil } @@ -1378,7 +1377,7 @@ func (e *Executor) initVreplicationRevertMigration(ctx context.Context, onlineDD // ExecuteWithVReplication sets up the grounds for a vreplication schema migration func (e *Executor) ExecuteWithVReplication(ctx context.Context, onlineDDL *schema.OnlineDDL, revertMigration *schema.OnlineDDL) error { // make sure there's no vreplication workflow running under same name - _ = e.terminateVReplMigration(ctx, onlineDDL.UUID) + _ = e.terminateVReplMigration(ctx, onlineDDL.Uuid) if e.tabletTypeFunc() != topodatapb.TabletType_PRIMARY { return ErrExecutorNotWritableTablet @@ -1390,8 +1389,8 @@ func (e *Executor) ExecuteWithVReplication(ctx context.Context, onlineDDL *schem } defer conn.Close() - e.ownedRunningMigrations.Store(onlineDDL.UUID, onlineDDL) - if err := e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusRunning, false, progressPctStarted, etaSecondsUnknown, rowsCopiedUnknown, emptyHint); err != nil { + e.ownedRunningMigrations.Store(onlineDDL.Uuid, onlineDDL) + if err := e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_RUNNING, false, progressPctStarted, etaSecondsUnknown, rowsCopiedUnknown, emptyHint); err != nil { return err } @@ -1409,7 +1408,7 @@ func (e *Executor) ExecuteWithVReplication(ctx context.Context, onlineDDL *schem if err := v.analyze(ctx, conn); err != nil { return err } - if err := e.updateMigrationTableRows(ctx, onlineDDL.UUID, v.tableRows); err != nil { + if err := e.updateMigrationTableRows(ctx, onlineDDL.Uuid, v.tableRows); err != nil { return err } removedUniqueKeyNames := []string{} @@ -1417,7 +1416,7 @@ func (e *Executor) ExecuteWithVReplication(ctx context.Context, onlineDDL *schem removedUniqueKeyNames = append(removedUniqueKeyNames, uniqueKey.Name) } - if err := e.updateSchemaAnalysis(ctx, onlineDDL.UUID, + if err := e.updateSchemaAnalysis(ctx, onlineDDL.Uuid, len(v.addedUniqueKeys), len(v.removedUniqueKeys), strings.Join(sqlescape.EscapeIDs(removedUniqueKeyNames), ","), @@ -1502,7 +1501,7 @@ func (e *Executor) ExecuteWithGhost(ctx context.Context, onlineDDL *schema.Onlin log.Errorf(err.Error()) return err } - tempDir, err := createTempDir(onlineDDL.UUID) + tempDir, err := createTempDir(onlineDDL.Uuid) if err != nil { log.Errorf("Error creating temporary directory: %+v", err) return err @@ -1536,43 +1535,43 @@ exit $exit_code log.Errorf("Error creating wrapper script: %+v", err) return err } - onHookContent := func(status schema.OnlineDDLStatus, hint string) string { + onHookContent := func(status tabletmanagerdatapb.OnlineDDL_Status, hint string) string { return fmt.Sprintf(`#!/bin/bash curl --max-time 10 -s 'http://localhost:%d/schema-migration/report-status?uuid=%s&status=%s&hint=%s&dryrun='"$GH_OST_DRY_RUN"'&progress='"$GH_OST_PROGRESS"'&eta='"$GH_OST_ETA_SECONDS"'&rowscopied='"$GH_OST_COPIED_ROWS" - `, servenv.Port(), onlineDDL.UUID, string(status), hint) + `, servenv.Port(), onlineDDL.Uuid, schema.OnlineDDLStatusName(status), hint) } - if _, err := createTempScript(tempDir, "gh-ost-on-startup", onHookContent(schema.OnlineDDLStatusRunning, emptyHint)); err != nil { + if _, err := createTempScript(tempDir, "gh-ost-on-startup", onHookContent(tabletmanagerdatapb.OnlineDDL_RUNNING, emptyHint)); err != nil { log.Errorf("Error creating script: %+v", err) return err } - if _, err := createTempScript(tempDir, "gh-ost-on-status", onHookContent(schema.OnlineDDLStatusRunning, emptyHint)); err != nil { + if _, err := createTempScript(tempDir, "gh-ost-on-status", onHookContent(tabletmanagerdatapb.OnlineDDL_RUNNING, emptyHint)); err != nil { log.Errorf("Error creating script: %+v", err) return err } - if _, err := createTempScript(tempDir, "gh-ost-on-success", onHookContent(schema.OnlineDDLStatusComplete, emptyHint)); err != nil { + if _, err := createTempScript(tempDir, "gh-ost-on-success", onHookContent(tabletmanagerdatapb.OnlineDDL_COMPLETE, emptyHint)); err != nil { log.Errorf("Error creating script: %+v", err) return err } - if _, err := createTempScript(tempDir, "gh-ost-on-failure", onHookContent(schema.OnlineDDLStatusFailed, emptyHint)); err != nil { + if _, err := createTempScript(tempDir, "gh-ost-on-failure", onHookContent(tabletmanagerdatapb.OnlineDDL_FAILED, emptyHint)); err != nil { log.Errorf("Error creating script: %+v", err) return err } - if _, err := createTempScript(tempDir, "gh-ost-on-begin-postponed", onHookContent(schema.OnlineDDLStatusRunning, readyToCompleteHint)); err != nil { + if _, err := createTempScript(tempDir, "gh-ost-on-begin-postponed", onHookContent(tabletmanagerdatapb.OnlineDDL_RUNNING, readyToCompleteHint)); err != nil { log.Errorf("Error creating script: %+v", err) return err } serveSocketFile := path.Join(tempDir, "serve.sock") - if err := e.deleteGhostPanicFlagFile(onlineDDL.UUID); err != nil { - log.Errorf("Error removing gh-ost panic flag file %s: %+v", e.ghostPanicFlagFileName(onlineDDL.UUID), err) + if err := e.deleteGhostPanicFlagFile(onlineDDL.Uuid); err != nil { + log.Errorf("Error removing gh-ost panic flag file %s: %+v", e.ghostPanicFlagFileName(onlineDDL.Uuid), err) return err } - if err := e.deleteGhostPostponeFlagFile(onlineDDL.UUID); err != nil { - log.Errorf("Error removing gh-ost postpone flag file %s before migration: %+v", e.ghostPostponeFlagFileName(onlineDDL.UUID), err) + if err := e.deleteGhostPostponeFlagFile(onlineDDL.Uuid); err != nil { + log.Errorf("Error removing gh-ost postpone flag file %s before migration: %+v", e.ghostPostponeFlagFileName(onlineDDL.Uuid), err) return err } // Validate gh-ost binary: - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, "validating gh-ost --version") + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, "validating gh-ost --version") log.Infof("Will now validate gh-ost binary") _, err = execCmd( "bash", @@ -1589,18 +1588,18 @@ exit $exit_code log.Errorf("Error testing gh-ost binary: %+v", err) return err } - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, "validated gh-ost --version") + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, "validated gh-ost --version") log.Infof("+ OK") - if err := e.updateMigrationLogPath(ctx, onlineDDL.UUID, variables.host, tempDir); err != nil { + if err := e.updateMigrationLogPath(ctx, onlineDDL.Uuid, variables.host, tempDir); err != nil { return err } runGhost := func(execute bool) error { alterOptions := e.parseAlterOptions(ctx, onlineDDL) - forceTableNames := fmt.Sprintf("%s_%s", onlineDDL.UUID, ReadableTimestamp()) + forceTableNames := fmt.Sprintf("%s_%s", onlineDDL.Uuid, ReadableTimestamp()) - if err := e.updateArtifacts(ctx, onlineDDL.UUID, + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, fmt.Sprintf("_%s_gho", forceTableNames), fmt.Sprintf("_%s_ghc", forceTableNames), fmt.Sprintf("_%s_del", forceTableNames), @@ -1625,25 +1624,25 @@ exit $exit_code fmt.Sprintf("--force-table-names=%s", forceTableNames), fmt.Sprintf("--serve-socket-file=%s", serveSocketFile), fmt.Sprintf("--hooks-path=%s", tempDir), - fmt.Sprintf(`--hooks-hint-token=%s`, onlineDDL.UUID), - fmt.Sprintf(`--throttle-http=http://localhost:%d/throttler/check?app=%s:%s:%s&p=low`, servenv.Port(), throttlerapp.OnlineDDLName, throttlerapp.GhostName, onlineDDL.UUID), + fmt.Sprintf(`--hooks-hint-token=%s`, onlineDDL.Uuid), + fmt.Sprintf(`--throttle-http=http://localhost:%d/throttler/check?app=%s:%s:%s&p=low`, servenv.Port(), throttlerapp.OnlineDDLName, throttlerapp.GhostName, onlineDDL.Uuid), fmt.Sprintf(`--database=%s`, e.dbName), fmt.Sprintf(`--table=%s`, onlineDDL.Table), fmt.Sprintf(`--alter=%s`, alterOptions), - fmt.Sprintf(`--panic-flag-file=%s`, e.ghostPanicFlagFileName(onlineDDL.UUID)), + fmt.Sprintf(`--panic-flag-file=%s`, e.ghostPanicFlagFileName(onlineDDL.Uuid)), fmt.Sprintf(`--execute=%t`, execute), } if onlineDDL.StrategySetting().IsAllowZeroInDateFlag() { args = append(args, "--allow-zero-in-date") } if execute && onlineDDL.StrategySetting().IsPostponeCompletion() { - args = append(args, "--postpone-cut-over-flag-file", e.ghostPostponeFlagFileName(onlineDDL.UUID)) + args = append(args, "--postpone-cut-over-flag-file", e.ghostPostponeFlagFileName(onlineDDL.Uuid)) } args = append(args, onlineDDL.StrategySetting().RuntimeOptions()...) - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, fmt.Sprintf("executing gh-ost --execute=%v", execute)) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, fmt.Sprintf("executing gh-ost --execute=%v", execute)) _, err := execCmd("bash", args, os.Environ(), "/tmp", nil, nil) - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, fmt.Sprintf("executed gh-ost --execute=%v, err=%v", execute, err)) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, fmt.Sprintf("executed gh-ost --execute=%v, err=%v", execute, err)) if err != nil { // See if we can get more info from the failure file if content, ferr := os.ReadFile(path.Join(tempDir, migrationFailureFileName)); ferr == nil { @@ -1657,11 +1656,11 @@ exit $exit_code return err } - e.ownedRunningMigrations.Store(onlineDDL.UUID, onlineDDL) + e.ownedRunningMigrations.Store(onlineDDL.Uuid, onlineDDL) go func() error { - defer e.ownedRunningMigrations.Delete(onlineDDL.UUID) - defer e.deleteGhostPostponeFlagFile(onlineDDL.UUID) // irrespective whether the file was in fact in use or not + defer e.ownedRunningMigrations.Delete(onlineDDL.Uuid) + defer e.deleteGhostPostponeFlagFile(onlineDDL.Uuid) // irrespective whether the file was in fact in use or not defer e.dropOnlineDDLUser(ctx) defer e.gcArtifacts(ctx) @@ -1716,7 +1715,7 @@ func (e *Executor) ExecuteWithPTOSC(ctx context.Context, onlineDDL *schema.Onlin log.Errorf(err.Error()) return err } - tempDir, err := createTempDir(onlineDDL.UUID) + tempDir, err := createTempDir(onlineDDL.Uuid) if err != nil { log.Errorf("Error creating temporary directory: %+v", err) return err @@ -1786,13 +1785,13 @@ export MYSQL_PWD 1; ` pluginCode = strings.ReplaceAll(pluginCode, "{{VTTABLET_PORT}}", fmt.Sprintf("%d", servenv.Port())) - pluginCode = strings.ReplaceAll(pluginCode, "{{MIGRATION_UUID}}", onlineDDL.UUID) + pluginCode = strings.ReplaceAll(pluginCode, "{{MIGRATION_UUID}}", onlineDDL.Uuid) pluginCode = strings.ReplaceAll(pluginCode, "{{THROTTLER_ONLINE_DDL_APP}}", throttlerapp.OnlineDDLName.String()) pluginCode = strings.ReplaceAll(pluginCode, "{{THROTTLER_PT_OSC_APP}}", throttlerapp.PTOSCName.String()) - pluginCode = strings.ReplaceAll(pluginCode, "{{OnlineDDLStatusRunning}}", string(schema.OnlineDDLStatusRunning)) - pluginCode = strings.ReplaceAll(pluginCode, "{{OnlineDDLStatusComplete}}", string(schema.OnlineDDLStatusComplete)) - pluginCode = strings.ReplaceAll(pluginCode, "{{OnlineDDLStatusFailed}}", string(schema.OnlineDDLStatusFailed)) + pluginCode = strings.ReplaceAll(pluginCode, "{{OnlineDDLStatusRunning}}", string(tabletmanagerdatapb.OnlineDDL_RUNNING)) + pluginCode = strings.ReplaceAll(pluginCode, "{{OnlineDDLStatusComplete}}", string(tabletmanagerdatapb.OnlineDDL_COMPLETE)) + pluginCode = strings.ReplaceAll(pluginCode, "{{OnlineDDLStatusFailed}}", string(tabletmanagerdatapb.OnlineDDL_FAILED)) // Validate pt-online-schema-change binary: log.Infof("Will now validate pt-online-schema-change binary") @@ -1813,7 +1812,7 @@ export MYSQL_PWD } log.Infof("+ OK") - if err := e.updateMigrationLogPath(ctx, onlineDDL.UUID, variables.host, tempDir); err != nil { + if err := e.updateMigrationLogPath(ctx, onlineDDL.Uuid, variables.host, tempDir); err != nil { return err } @@ -1829,9 +1828,9 @@ export MYSQL_PWD runPTOSC := func(execute bool) error { os.Setenv("MYSQL_PWD", onlineDDLPassword) - newTableName := fmt.Sprintf("_%s_%s_new", onlineDDL.UUID, ReadableTimestamp()) + newTableName := fmt.Sprintf("_%s_%s_new", onlineDDL.Uuid, ReadableTimestamp()) - if err := e.updateArtifacts(ctx, onlineDDL.UUID, + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, fmt.Sprintf("_%s_old", onlineDDL.Table), fmt.Sprintf("__%s_old", onlineDDL.Table), newTableName, @@ -1852,7 +1851,7 @@ export MYSQL_PWD args := []string{ wrapperScriptFileName, `--pid`, - e.ptPidFileName(onlineDDL.UUID), + e.ptPidFileName(onlineDDL.Uuid), `--plugin`, pluginFile, `--new-table-name`, @@ -1876,10 +1875,10 @@ export MYSQL_PWD return err } - e.ownedRunningMigrations.Store(onlineDDL.UUID, onlineDDL) + e.ownedRunningMigrations.Store(onlineDDL.Uuid, onlineDDL) go func() error { - defer e.ownedRunningMigrations.Delete(onlineDDL.UUID) + defer e.ownedRunningMigrations.Delete(onlineDDL.Uuid) defer e.dropOnlineDDLUser(ctx) defer e.gcArtifacts(ctx) @@ -1887,7 +1886,7 @@ export MYSQL_PWD if err := runPTOSC(false); err != nil { // perhaps pt-osc was interrupted midway and didn't have the chance to send a "failes" status _ = e.failMigration(ctx, onlineDDL, err) - _ = e.updateMigrationTimestamp(ctx, "completed_timestamp", onlineDDL.UUID) + _ = e.updateMigrationTimestamp(ctx, "completed_timestamp", onlineDDL.Uuid) log.Errorf("Error executing pt-online-schema-change dry run: %+v", err) return err } @@ -1898,7 +1897,7 @@ export MYSQL_PWD if err := runPTOSC(true); err != nil { // perhaps pt-osc was interrupted midway and didn't have the chance to send a "failes" status _ = e.failMigration(ctx, onlineDDL, err) - _ = e.updateMigrationTimestamp(ctx, "completed_timestamp", onlineDDL.UUID) + _ = e.updateMigrationTimestamp(ctx, "completed_timestamp", onlineDDL.Uuid) _ = e.dropPTOSCMigrationTriggers(ctx, onlineDDL) failedMigrations.Add(1) log.Errorf("Error running pt-online-schema-change: %+v", err) @@ -1930,20 +1929,32 @@ func (e *Executor) readMigration(ctx context.Context, uuid string) (onlineDDL *s // No results return nil, nil, ErrMigrationNotFound } + + strategy, err := schema.ParseDDLStrategyName(row["strategy"].ToString()) + if err != nil { + return onlineDDL, nil, err + } + + status, err := schema.ParseOnlineDDLStatus(row["migration_status"].ToString()) + if err != nil { + return onlineDDL, nil, err + } onlineDDL = &schema.OnlineDDL{ - Keyspace: row["keyspace"].ToString(), - Table: row["mysql_table"].ToString(), - Schema: row["mysql_schema"].ToString(), - SQL: row["migration_statement"].ToString(), - UUID: row["migration_uuid"].ToString(), - Strategy: schema.DDLStrategy(row["strategy"].ToString()), - Options: row["options"].ToString(), - Status: schema.OnlineDDLStatus(row["migration_status"].ToString()), - Retries: row.AsInt64("retries", 0), - ReadyToComplete: row.AsInt64("ready_to_complete", 0), - WasReadyToComplete: row.AsInt64("was_ready_to_complete", 0), - TabletAlias: row["tablet"].ToString(), - MigrationContext: row["migration_context"].ToString(), + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Keyspace: row["keyspace"].ToString(), + Table: row["mysql_table"].ToString(), + Schema: row["mysql_schema"].ToString(), + Sql: row["migration_statement"].ToString(), + Uuid: row["migration_uuid"].ToString(), + Strategy: strategy, + Options: row["options"].ToString(), + Retries: row.AsInt64("retries", 0), + Status: status, + ReadyToComplete: row.AsBool("ready_to_complete", false), + WasReadyToComplete: row.AsBool("was_ready_to_complete", false), + }, + TabletAlias: row["tablet"].ToString(), + MigrationContext: row["migration_context"].ToString(), } return onlineDDL, row, nil } @@ -1963,23 +1974,23 @@ func (e *Executor) readPendingMigrationsUUIDs(ctx context.Context) (uuids []stri // terminateMigration attempts to interrupt and hard-stop a running migration func (e *Executor) terminateMigration(ctx context.Context, onlineDDL *schema.OnlineDDL) (foundRunning bool, err error) { - log.Infof("terminateMigration: request to terminate %s", onlineDDL.UUID) + log.Infof("terminateMigration: request to terminate %s", onlineDDL.Uuid) // It's possible the killing the migration fails for whatever reason, in which case // the logic will retry killing it later on. // Whatever happens in this function, this executor stops owning the given migration. - defer e.ownedRunningMigrations.Delete(onlineDDL.UUID) + defer e.ownedRunningMigrations.Delete(onlineDDL.Uuid) switch onlineDDL.Strategy { - case schema.DDLStrategyOnline, schema.DDLStrategyVitess: + case tabletmanagerdatapb.OnlineDDL_VITESS: // alias: tabletmanagerdatapb.OnlineDDL_ONLINE // migration could have started by a different tablet. We need to actively verify if it is running - s, _ := e.readVReplStream(ctx, onlineDDL.UUID, true) + s, _ := e.readVReplStream(ctx, onlineDDL.Uuid, true) foundRunning = (s != nil && s.isRunning()) - if err := e.terminateVReplMigration(ctx, onlineDDL.UUID); err != nil { + if err := e.terminateVReplMigration(ctx, onlineDDL.Uuid); err != nil { return foundRunning, fmt.Errorf("Error terminating migration, vreplication exec error: %+v", err) } - case schema.DDLStrategyPTOSC: + case tabletmanagerdatapb.OnlineDDL_PTOSC: // see if pt-osc is running (could have been executed by this vttablet or one that crashed in the past) - if running, pid, _ := e.isPTOSCMigrationRunning(ctx, onlineDDL.UUID); running { + if running, pid, _ := e.isPTOSCMigrationRunning(ctx, onlineDDL.Uuid); running { foundRunning = true // Because pt-osc doesn't offer much control, we take a brute force approach to killing it, // revoking its privileges, and cleaning up its triggers. @@ -1996,15 +2007,15 @@ func (e *Executor) terminateMigration(ctx context.Context, onlineDDL *schema.Onl return foundRunning, nil } } - case schema.DDLStrategyGhost: + case tabletmanagerdatapb.OnlineDDL_GHOST: // double check: is the running migration the very same one we wish to cancel? - if _, ok := e.ownedRunningMigrations.Load(onlineDDL.UUID); ok { + if _, ok := e.ownedRunningMigrations.Load(onlineDDL.Uuid); ok { // assuming all goes well in next steps, we can already report that there has indeed been a migration foundRunning = true } // gh-ost migrations are easy to kill: just touch their specific panic flag files. We trust // gh-ost to terminate. No need to KILL it. And there's no trigger cleanup. - if err := e.createGhostPanicFlagFile(onlineDDL.UUID); err != nil { + if err := e.createGhostPanicFlagFile(onlineDDL.Uuid); err != nil { return foundRunning, fmt.Errorf("Error terminating gh-ost migration, flag file error: %+v", err) } } @@ -2029,7 +2040,7 @@ func (e *Executor) CancelMigration(ctx context.Context, uuid string, message str } switch onlineDDL.Status { - case schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed, schema.OnlineDDLStatusCancelled: + case tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED, tabletmanagerdatapb.OnlineDDL_CANCELLED: log.Infof("CancelMigration: migration %s is in non-cancellable status: %v", uuid, onlineDDL.Status) return emptyResult, nil } @@ -2048,7 +2059,7 @@ func (e *Executor) CancelMigration(ctx context.Context, uuid string, message str defer e.triggerNextCheckInterval() switch onlineDDL.Status { - case schema.OnlineDDLStatusQueued, schema.OnlineDDLStatusReady: + case tabletmanagerdatapb.OnlineDDL_QUEUED, tabletmanagerdatapb.OnlineDDL_READY: log.Infof("CancelMigration: cancelling %s with status: %v", uuid, onlineDDL.Status) return &sqltypes.Result{RowsAffected: 1}, nil } @@ -2212,7 +2223,7 @@ func (e *Executor) scheduleNextMigration(ctx context.Context) error { // postponed ALTER can be scheduled (because gh-ost or vreplication will postpone the cut-over) // We only schedule a single migration in the execution of this function onlyScheduleOneMigration.Do(func() { - err = e.updateMigrationStatus(ctx, uuid, schema.OnlineDDLStatusReady) + err = e.updateMigrationStatus(ctx, uuid, tabletmanagerdatapb.OnlineDDL_READY) log.Infof("Executor.scheduleNextMigration: scheduling migration %s; err: %v", uuid, err) e.triggerNextCheckInterval() }) @@ -2241,11 +2252,11 @@ func (e *Executor) reviewEmptyTableRevertMigrations(ctx context.Context, onlineD // Failure to do so fails the migration revertUUID, err := onlineDDL.GetRevertUUID() if err != nil { - return false, e.failMigration(ctx, onlineDDL, fmt.Errorf("cannot analyze revert UUID for revert migration %s: %v", onlineDDL.UUID, err)) + return false, e.failMigration(ctx, onlineDDL, fmt.Errorf("cannot analyze revert UUID for revert migration %s: %v", onlineDDL.Uuid, err)) } revertedMigration, revertedRow, err := e.readMigration(ctx, revertUUID) if err != nil { - return false, e.failMigration(ctx, onlineDDL, fmt.Errorf("cannot read migration %s reverted by migration %s: %s", revertUUID, onlineDDL.UUID, err)) + return false, e.failMigration(ctx, onlineDDL, fmt.Errorf("cannot read migration %s reverted by migration %s: %s", revertUUID, onlineDDL.Uuid, err)) } revertedActionStr := revertedRow["ddl_action"].ToString() @@ -2258,15 +2269,15 @@ func (e *Executor) reviewEmptyTableRevertMigrations(ctx context.Context, onlineD case sqlparser.AlterStr: mimickedActionStr = sqlparser.AlterStr default: - return false, e.failMigration(ctx, onlineDDL, fmt.Errorf("cannot run migration %s reverting %s: unexpected action %s", onlineDDL.UUID, revertedMigration.UUID, revertedActionStr)) + return false, e.failMigration(ctx, onlineDDL, fmt.Errorf("cannot run migration %s reverting %s: unexpected action %s", onlineDDL.Uuid, revertedMigration.Uuid, revertedActionStr)) } - if err := e.updateDDLAction(ctx, onlineDDL.UUID, mimickedActionStr); err != nil { + if err := e.updateDDLAction(ctx, onlineDDL.Uuid, mimickedActionStr); err != nil { return false, err } - if err := e.updateMigrationIsView(ctx, onlineDDL.UUID, revertedRow.AsBool("is_view", false)); err != nil { + if err := e.updateMigrationIsView(ctx, onlineDDL.Uuid, revertedRow.AsBool("is_view", false)); err != nil { return false, err } - if err := e.updateMySQLTable(ctx, onlineDDL.UUID, revertedMigration.Table); err != nil { + if err := e.updateMySQLTable(ctx, onlineDDL.Uuid, revertedMigration.Table); err != nil { return false, err } return true, nil @@ -2354,13 +2365,13 @@ func (e *Executor) reviewQueuedMigrations(ctx context.Context) error { return err } if isImmediate { - if err := e.updateMigrationSetImmediateOperation(ctx, onlineDDL.UUID); err != nil { + if err := e.updateMigrationSetImmediateOperation(ctx, onlineDDL.Uuid); err != nil { return err } } // Find conditions where the migration cannot take place: switch onlineDDL.Strategy { - case schema.DDLStrategyMySQL: + case tabletmanagerdatapb.OnlineDDL_MYSQL: strategySetting := onlineDDL.StrategySetting() if strategySetting.IsPostponeCompletion() { e.failMigration(ctx, onlineDDL, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "--postpone-completion not supported in 'mysql' strategy")) @@ -2389,17 +2400,17 @@ func (e *Executor) validateMigrationRevertible(ctx context.Context, revertMigrat } switch action { case sqlparser.AlterDDLAction: - if revertMigration.Strategy != schema.DDLStrategyOnline && revertMigration.Strategy != schema.DDLStrategyVitess { - return fmt.Errorf("can only revert a %s strategy migration. Migration %s has %s strategy", schema.DDLStrategyOnline, revertMigration.UUID, revertMigration.Strategy) + if revertMigration.Strategy != tabletmanagerdatapb.OnlineDDL_ONLINE && revertMigration.Strategy != tabletmanagerdatapb.OnlineDDL_VITESS { + return fmt.Errorf("can only revert a %s strategy migration. Migration %s has %s strategy", tabletmanagerdatapb.OnlineDDL_ONLINE, revertMigration.Uuid, revertMigration.Strategy) } case sqlparser.RevertDDLAction: case sqlparser.CreateDDLAction: case sqlparser.DropDDLAction: default: - return fmt.Errorf("cannot revert migration %s: unexpected action %s", revertMigration.UUID, actionStr) + return fmt.Errorf("cannot revert migration %s: unexpected action %s", revertMigration.Uuid, actionStr) } - if revertMigration.Status != schema.OnlineDDLStatusComplete { - return fmt.Errorf("can only revert a migration in a '%s' state. Migration %s is in '%s' state", schema.OnlineDDLStatusComplete, revertMigration.UUID, revertMigration.Status) + if revertMigration.Status != tabletmanagerdatapb.OnlineDDL_COMPLETE { + return fmt.Errorf("can only revert a migration in a '%s' state. Migration %s is in '%s' state", tabletmanagerdatapb.OnlineDDL_COMPLETE, revertMigration.Uuid, revertMigration.Status) } { // Validation: see if there's a pending migration on this table: @@ -2416,10 +2427,14 @@ func (e *Executor) validateMigrationRevertible(ctx context.Context, revertMigrat } keyspace := row["keyspace"].ToString() table := row["mysql_table"].ToString() - status := schema.OnlineDDLStatus(row["migration_status"].ToString()) + + status, err := schema.ParseOnlineDDLStatus(row["migration_status"].ToString()) + if err != nil { + return fmt.Errorf("cannot revert migration %s on table %s because migration %s has unknown status: %w", revertMigration.Uuid, revertMigration.Table, pendingUUID, err) + } if keyspace == e.keyspace && table == revertMigration.Table { - return fmt.Errorf("can not revert migration %s on table %s because migration %s is in %s status. May only revert if all migrations on this table are completed or failed", revertMigration.UUID, revertMigration.Table, pendingUUID, status) + return fmt.Errorf("can not revert migration %s on table %s because migration %s is in %s status. May only revert if all migrations on this table are completed or failed", revertMigration.Uuid, revertMigration.Table, pendingUUID, status) } } { @@ -2437,8 +2452,8 @@ func (e *Executor) validateMigrationRevertible(ctx context.Context, revertMigrat } for _, row := range r.Named().Rows { completeUUID := row["migration_uuid"].ToString() - if completeUUID != revertMigration.UUID { - return fmt.Errorf("can not revert migration %s on table %s because it is not the last migration to complete on that table. The last migration to complete was %s", revertMigration.UUID, revertMigration.Table, completeUUID) + if completeUUID != revertMigration.Uuid { + return fmt.Errorf("can not revert migration %s on table %s because it is not the last migration to complete on that table. The last migration to complete was %s", revertMigration.Uuid, revertMigration.Table, completeUUID) } } } @@ -2454,14 +2469,14 @@ func (e *Executor) validateMigrationRevertible(ctx context.Context, revertMigrat func (e *Executor) executeRevert(ctx context.Context, onlineDDL *schema.OnlineDDL) (err error) { revertUUID, err := onlineDDL.GetRevertUUID() if err != nil { - return fmt.Errorf("cannot run a revert migration %v: %+v", onlineDDL.UUID, err) + return fmt.Errorf("cannot run a revert migration %v: %+v", onlineDDL.Uuid, err) } revertMigration, row, err := e.readMigration(ctx, revertUUID) if err != nil { return err } - if err := e.validateMigrationRevertible(ctx, revertMigration, onlineDDL.UUID); err != nil { + if err := e.validateMigrationRevertible(ctx, revertMigration, onlineDDL.Uuid); err != nil { return err } @@ -2480,18 +2495,18 @@ func (e *Executor) executeRevert(ctx context.Context, onlineDDL *schema.OnlineDD artifacts := row["artifacts"].ToString() artifactTables := textutil.SplitDelimitedList(artifacts) if len(artifactTables) > 1 { - return fmt.Errorf("cannot run migration %s reverting %s: found %d artifact tables, expected maximum 1", onlineDDL.UUID, revertMigration.UUID, len(artifactTables)) + return fmt.Errorf("cannot run migration %s reverting %s: found %d artifact tables, expected maximum 1", onlineDDL.Uuid, revertMigration.Uuid, len(artifactTables)) } if len(artifactTables) == 0 { // This indicates no table was actually created. this must have been a CREATE TABLE IF NOT EXISTS where the table already existed. - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) } for _, artifactTable := range artifactTables { - if err := e.updateArtifacts(ctx, onlineDDL.UUID, artifactTable); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, artifactTable); err != nil { return err } - onlineDDL.SQL = sqlparser.BuildParsedQuery(sqlRenameTable, revertMigration.Table, artifactTable).Query + onlineDDL.Sql = sqlparser.BuildParsedQuery(sqlRenameTable, revertMigration.Table, artifactTable).Query if _, err := e.executeDirectly(ctx, onlineDDL); err != nil { return err } @@ -2506,17 +2521,17 @@ func (e *Executor) executeRevert(ctx context.Context, onlineDDL *schema.OnlineDD artifacts := row["artifacts"].ToString() artifactTables := textutil.SplitDelimitedList(artifacts) if len(artifactTables) > 1 { - return fmt.Errorf("cannot run migration %s reverting %s: found %d artifact tables, expected maximum 1", onlineDDL.UUID, revertMigration.UUID, len(artifactTables)) + return fmt.Errorf("cannot run migration %s reverting %s: found %d artifact tables, expected maximum 1", onlineDDL.Uuid, revertMigration.Uuid, len(artifactTables)) } if len(artifactTables) == 0 { // Could happen on `DROP TABLE IF EXISTS` where the table did not exist... - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) } for _, artifactTable := range artifactTables { - if err := e.updateArtifacts(ctx, onlineDDL.UUID, artifactTable); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, artifactTable); err != nil { return err } - onlineDDL.SQL = sqlparser.BuildParsedQuery(sqlRenameTable, artifactTable, revertMigration.Table).Query + onlineDDL.Sql = sqlparser.BuildParsedQuery(sqlRenameTable, artifactTable, revertMigration.Table).Query if _, err := e.executeDirectly(ctx, onlineDDL); err != nil { return err } @@ -2528,16 +2543,16 @@ func (e *Executor) executeRevert(ctx context.Context, onlineDDL *schema.OnlineDD artifacts := row["artifacts"].ToString() artifactTables := textutil.SplitDelimitedList(artifacts) if len(artifactTables) > 1 { - return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot run migration %s reverting %s: found %d artifact tables, expected maximum 1", onlineDDL.UUID, revertMigration.UUID, len(artifactTables)) + return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot run migration %s reverting %s: found %d artifact tables, expected maximum 1", onlineDDL.Uuid, revertMigration.Uuid, len(artifactTables)) } if len(artifactTables) == 0 { - return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot run migration %s reverting %s: found %d artifact tables, expected 1", onlineDDL.UUID, revertMigration.UUID, len(artifactTables)) + return vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "cannot run migration %s reverting %s: found %d artifact tables, expected 1", onlineDDL.Uuid, revertMigration.Uuid, len(artifactTables)) } for _, artifactTable := range artifactTables { - if err := e.updateArtifacts(ctx, onlineDDL.UUID, artifactTable); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, artifactTable); err != nil { return err } - onlineDDL.SQL, _, err = e.generateSwapTablesStatement(ctx, onlineDDL.Table, artifactTable) + onlineDDL.Sql, _, err = e.generateSwapTablesStatement(ctx, onlineDDL.Table, artifactTable) if err != nil { return err } @@ -2553,7 +2568,7 @@ func (e *Executor) executeRevert(ctx context.Context, onlineDDL *schema.OnlineDD } } default: - return fmt.Errorf("cannot run migration %s reverting %s: unexpected action %s", onlineDDL.UUID, revertMigration.UUID, revertedActionStr) + return fmt.Errorf("cannot run migration %s reverting %s: unexpected action %s", onlineDDL.Uuid, revertMigration.Uuid, revertedActionStr) } return nil @@ -2565,7 +2580,7 @@ func (e *Executor) executeRevert(ctx context.Context, onlineDDL *schema.OnlineDD func (e *Executor) evaluateDeclarativeDiff(ctx context.Context, onlineDDL *schema.OnlineDDL) (diff schemadiff.EntityDiff, err error) { // Modify the CREATE TABLE statement to indicate a different, made up table name, known as the "comparison table" - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return nil, err } @@ -2626,7 +2641,7 @@ func (e *Executor) evaluateDeclarativeDiff(ctx context.Context, onlineDDL *schem case *sqlparser.CreateView: diff, err = schemadiff.DiffCreateViewsQueries(existingShowCreateTable, newShowCreateTable, hints) default: - return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "expected CREATE TABLE or CREATE VIEW in online DDL statement: %v", onlineDDL.SQL) + return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "expected CREATE TABLE or CREATE VIEW in online DDL statement: %v", onlineDDL.Sql) } if err != nil { return nil, err @@ -2644,7 +2659,7 @@ func (e *Executor) getCompletedMigrationByContextAndSQL(ctx context.Context, onl query, err := sqlparser.ParseAndBind(sqlSelectCompleteMigrationsByContextAndSQL, sqltypes.StringBindVariable(e.keyspace), sqltypes.StringBindVariable(onlineDDL.MigrationContext), - sqltypes.StringBindVariable(onlineDDL.SQL), + sqltypes.StringBindVariable(onlineDDL.Sql), ) if err != nil { return "", err @@ -2662,11 +2677,11 @@ func (e *Executor) getCompletedMigrationByContextAndSQL(ctx context.Context, onl // failMigration marks a migration as failed func (e *Executor) failMigration(ctx context.Context, onlineDDL *schema.OnlineDDL, withError error) error { defer e.triggerNextCheckInterval() - _ = e.updateMigrationStatusFailedOrCancelled(ctx, onlineDDL.UUID) + _ = e.updateMigrationStatusFailedOrCancelled(ctx, onlineDDL.Uuid) if withError != nil { - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, withError.Error()) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, withError.Error()) } - e.ownedRunningMigrations.Delete(onlineDDL.UUID) + e.ownedRunningMigrations.Delete(onlineDDL.Uuid) return withError } @@ -2690,17 +2705,17 @@ func (e *Executor) executeDropDDLActionMigration(ctx context.Context, onlineDDL // We transform a DROP TABLE into a RENAME TABLE statement, so as to remove the table safely and asynchronously. - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return failMigration(err) } var toTableName string - onlineDDL.SQL, toTableName, err = schema.GenerateRenameStatementWithUUID(onlineDDL.Table, schema.HoldTableGCState, onlineDDL.GetGCUUID(), newGCTableRetainTime()) + onlineDDL.Sql, toTableName, err = schema.GenerateRenameStatementWithUUID(onlineDDL.Table, schema.HoldTableGCState, onlineDDL.GetGCUUID(), newGCTableRetainTime()) if err != nil { return failMigration(err) } - if err := e.updateArtifacts(ctx, onlineDDL.UUID, toTableName); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, toTableName); err != nil { return err } @@ -2714,7 +2729,7 @@ func (e *Executor) executeDropDDLActionMigration(ctx context.Context, onlineDDL } if acceptableErrCodeFound { // Table did not exist after all. There is no artifact - if err := e.clearArtifacts(ctx, onlineDDL.UUID); err != nil { + if err := e.clearArtifacts(ctx, onlineDDL.Uuid); err != nil { return err } } @@ -2729,7 +2744,7 @@ func (e *Executor) executeCreateDDLActionMigration(ctx context.Context, onlineDD e.migrationMutex.Lock() defer e.migrationMutex.Unlock() - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return failMigration(err) } @@ -2758,7 +2773,7 @@ func (e *Executor) executeCreateDDLActionMigration(ctx context.Context, onlineDD } // we create a dummy artifact. Its existence means the table was created by this migration. // It will be read by the revert operation. - if err := e.updateArtifacts(ctx, onlineDDL.UUID, sentryArtifactTableName); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, sentryArtifactTableName); err != nil { return err } @@ -2773,7 +2788,7 @@ func (e *Executor) executeCreateDDLActionMigration(ctx context.Context, onlineDD if exists { // the table already exists. This CREATE TABLE IF NOT EXISTS statement is a noop. // We therefore clear the artifact field. A revert operation will use this as a hint. - if err := e.clearArtifacts(ctx, onlineDDL.UUID); err != nil { + if err := e.clearArtifacts(ctx, onlineDDL.Uuid); err != nil { return failMigration(err) } } @@ -2831,7 +2846,7 @@ func (e *Executor) executeAlterViewOnline(ctx context.Context, onlineDDL *schema if err != nil { return err } - stmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + stmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return err } @@ -2864,15 +2879,15 @@ func (e *Executor) executeAlterViewOnline(ctx context.Context, onlineDDL *schema } defer conn.Close() - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusRunning, false, progressPctStarted, etaSecondsUnknown, rowsCopiedUnknown, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_RUNNING, false, progressPctStarted, etaSecondsUnknown, rowsCopiedUnknown, emptyHint) if _, err := conn.ExecuteFetch(artifactViewCreateSQL, 0, false); err != nil { return err } - if err := e.clearArtifacts(ctx, onlineDDL.UUID); err != nil { + if err := e.clearArtifacts(ctx, onlineDDL.Uuid); err != nil { return err } - if err := e.updateArtifacts(ctx, onlineDDL.UUID, artifactViewName); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, artifactViewName); err != nil { return err } @@ -2887,11 +2902,11 @@ func (e *Executor) executeAlterViewOnline(ctx context.Context, onlineDDL *schema // Make sure this is considered as an ALTER. // Either the user issued a ALTER VIEW, and the action is trivially ALTER, // or the user issues a CREATE OR REPLACE, and the view existed, in which case this is implicitly an ALTER - if err := e.updateDDLAction(ctx, onlineDDL.UUID, sqlparser.AlterStr); err != nil { + if err := e.updateDDLAction(ctx, onlineDDL.Uuid, sqlparser.AlterStr); err != nil { return err } - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) return nil } @@ -2932,7 +2947,7 @@ func (e *Executor) executeSpecialAlterDDLActionMigrationIfApplicable(ctx context switch specialPlan.operation { case instantDDLSpecialOperation: e.addInstantAlgorithm(specialPlan.alterTable) - onlineDDL.SQL = sqlparser.CanonicalString(specialPlan.alterTable) + onlineDDL.Sql = sqlparser.CanonicalString(specialPlan.alterTable) if _, err := e.executeDirectly(ctx, onlineDDL); err != nil { return false, err } @@ -2942,7 +2957,7 @@ func (e *Executor) executeSpecialAlterDDLActionMigrationIfApplicable(ctx context if err != nil { return err } - if err := e.updateArtifacts(ctx, onlineDDL.UUID, artifactTableName); err != nil { + if err := e.updateArtifacts(ctx, onlineDDL.Uuid, artifactTableName); err != nil { return err } @@ -2978,10 +2993,10 @@ func (e *Executor) executeSpecialAlterDDLActionMigrationIfApplicable(ctx context default: return false, nil } - if err := e.updateMigrationSpecialPlan(ctx, onlineDDL.UUID, specialPlan.String()); err != nil { + if err := e.updateMigrationSpecialPlan(ctx, onlineDDL.Uuid, specialPlan.String()); err != nil { return true, err } - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) return true, nil } @@ -2990,7 +3005,7 @@ func (e *Executor) executeAlterDDLActionMigration(ctx context.Context, onlineDDL failMigration := func(err error) error { return e.failMigration(ctx, onlineDDL, err) } - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return failMigration(err) } @@ -3027,19 +3042,19 @@ func (e *Executor) executeAlterDDLActionMigration(ctx context.Context, onlineDDL // OK, nothing special about this ALTER. Let's go ahead and execute it. switch onlineDDL.Strategy { - case schema.DDLStrategyOnline, schema.DDLStrategyVitess: + case tabletmanagerdatapb.OnlineDDL_VITESS: // alias: tabletmanagerdatapb.OnlineDDL_ONLINE if err := e.ExecuteWithVReplication(ctx, onlineDDL, nil); err != nil { return failMigration(err) } - case schema.DDLStrategyGhost: + case tabletmanagerdatapb.OnlineDDL_GHOST: if err := e.ExecuteWithGhost(ctx, onlineDDL); err != nil { return failMigration(err) } - case schema.DDLStrategyPTOSC: + case tabletmanagerdatapb.OnlineDDL_PTOSC: if err := e.ExecuteWithPTOSC(ctx, onlineDDL); err != nil { return failMigration(err) } - case schema.DDLStrategyMySQL: + case tabletmanagerdatapb.OnlineDDL_MYSQL: if _, err := e.executeDirectly(ctx, onlineDDL); err != nil { return failMigration(err) } @@ -3079,8 +3094,8 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin } if completedUUID != "" { // Yep. We mark this migration as implicitly complete, and we're done with it! - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, fmt.Sprintf("duplicate DDL as %s for migration context %s", completedUUID, onlineDDL.MigrationContext)) + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, fmt.Sprintf("duplicate DDL as %s for migration context %s", completedUUID, onlineDDL.MigrationContext)) return nil } } @@ -3090,19 +3105,19 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin case sqlparser.RevertDDLAction: // No special action. Declarative Revert migrations are handled like any normal Revert migration. case sqlparser.AlterDDLAction: - return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. ALTER cannot run in declarative mode for migration %v", onlineDDL.UUID)) + return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. ALTER cannot run in declarative mode for migration %v", onlineDDL.Uuid)) case sqlparser.DropDDLAction: // This DROP is declarative, meaning it may: // - actually DROP a table, if that table exists, or // - Implicitly do nothing, if the table does not exist { // Sanity: reject IF NOT EXISTS statements, because they don't make sense (or are ambiguous) in declarative mode - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return failMigration(err) } if ddlStmt.GetIfExists() { - return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. IF EXISTS does not work in declarative mode for migration %v", onlineDDL.UUID)) + return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. IF EXISTS does not work in declarative mode for migration %v", onlineDDL.Uuid)) } } exists, err := e.tableExists(ctx, onlineDDL.Table) @@ -3113,8 +3128,8 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin // table does exist, so this declarative DROP turns out to really be an actual DROP. No further action is needed here } else { // table does not exist. We mark this DROP as implicitly sucessful - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, "no change") + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, "no change") return nil } case sqlparser.CreateDDLAction: @@ -3124,15 +3139,15 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin // - Implicitly do nothing, if the table exists and is identical to CREATE statement // Sanity: reject IF NOT EXISTS statements, because they don't make sense (or are ambiguous) in declarative mode - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err != nil { return failMigration(err) } if ddlStmt.GetIfNotExists() { - return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. IF NOT EXISTS does not work in declarative mode for migration %v", onlineDDL.UUID)) + return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. IF NOT EXISTS does not work in declarative mode for migration %v", onlineDDL.Uuid)) } if ddlStmt.GetIsReplace() { - return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. OR REPLACE does not work in declarative mode for migration %v", onlineDDL.UUID)) + return failMigration(vterrors.Errorf(vtrpcpb.Code_UNIMPLEMENTED, "strategy is declarative. OR REPLACE does not work in declarative mode for migration %v", onlineDDL.Uuid)) } exists, err := e.tableExists(ctx, onlineDDL.Table) @@ -3146,25 +3161,25 @@ func (e *Executor) executeMigration(ctx context.Context, onlineDDL *schema.Onlin } if diff == nil || diff.IsEmpty() { // No diff! We mark this CREATE as implicitly sucessful - _ = e.onSchemaMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusComplete, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, "no change") + _ = e.onSchemaMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_COMPLETE, false, progressPctFull, etaSecondsNow, rowsCopiedUnknown, emptyHint) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, "no change") return nil } // alterClause is non empty. We convert this migration into an ALTER - if err := e.updateDDLAction(ctx, onlineDDL.UUID, sqlparser.AlterStr); err != nil { + if err := e.updateDDLAction(ctx, onlineDDL.Uuid, sqlparser.AlterStr); err != nil { return failMigration(err) } if createViewStmt, isCreateView := ddlStmt.(*sqlparser.CreateView); isCreateView { // Rewrite as CREATE OR REPLACE // this will be handled later on. createViewStmt.IsReplace = true - onlineDDL.SQL = sqlparser.String(createViewStmt) + onlineDDL.Sql = sqlparser.String(createViewStmt) } else { // a TABLE ddlAction = sqlparser.AlterDDLAction - onlineDDL.SQL = diff.CanonicalStatementString() + onlineDDL.Sql = diff.CanonicalStatementString() } - _ = e.updateMigrationMessage(ctx, onlineDDL.UUID, diff.CanonicalStatementString()) + _ = e.updateMigrationMessage(ctx, onlineDDL.Uuid, diff.CanonicalStatementString()) } else { { // table does not exist, so this declarative CREATE turns out to really be an actual CREATE. No further action is needed here. @@ -3244,7 +3259,7 @@ func (e *Executor) runNextMigration(ctx context.Context) error { } if isImmediateOperation && onlineDDL.StrategySetting().IsInOrderCompletion() { // This migration is immediate: if we run it now, it will complete within a second or two at most. - if len(pendingMigrationsUUIDs) > 0 && pendingMigrationsUUIDs[0] != onlineDDL.UUID { + if len(pendingMigrationsUUIDs) > 0 && pendingMigrationsUUIDs[0] != onlineDDL.Uuid { continue } } @@ -3265,13 +3280,13 @@ func (e *Executor) runNextMigration(ctx context.Context) error { } { // We strip out any VT query comments because our simplified parser doesn't work well with comments - ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.SQL) + ddlStmt, _, err := schema.ParseOnlineDDLStatement(onlineDDL.Sql) if err == nil { ddlStmt.SetComments(sqlparser.Comments{}) - onlineDDL.SQL = sqlparser.String(ddlStmt) + onlineDDL.Sql = sqlparser.String(ddlStmt) } } - log.Infof("Executor.runNextMigration: migration %s is non conflicting and will be executed next", onlineDDL.UUID) + log.Infof("Executor.runNextMigration: migration %s is non conflicting and will be executed next", onlineDDL.Uuid) e.executeMigration(ctx, onlineDDL) return nil } @@ -3503,7 +3518,7 @@ func (e *Executor) reviewRunningMigrations(ctx context.Context) (countRunnning i _ = e.updateMigrationUserThrottleRatio(ctx, uuid, currentUserThrottleRatio) switch onlineDDL.StrategySetting().Strategy { - case schema.DDLStrategyOnline, schema.DDLStrategyVitess: + case tabletmanagerdatapb.OnlineDDL_VITESS: // alias: tabletmanagerdatapb.OnlineDDL_ONLINE { // We check the _vt.vreplication table s, err := e.readVReplStream(ctx, uuid, true) @@ -3572,7 +3587,7 @@ func (e *Executor) reviewRunningMigrations(ctx context.Context) (countRunnning i isReady = false } if isReady && onlineDDL.StrategySetting().IsInOrderCompletion() { - if len(pendingMigrationsUUIDs) > 0 && pendingMigrationsUUIDs[0] != onlineDDL.UUID { + if len(pendingMigrationsUUIDs) > 0 && pendingMigrationsUUIDs[0] != onlineDDL.Uuid { // wait for earlier pending migrations to complete isReady = false } @@ -3592,7 +3607,7 @@ func (e *Executor) reviewRunningMigrations(ctx context.Context) (countRunnning i } } } - case schema.DDLStrategyPTOSC: + case tabletmanagerdatapb.OnlineDDL_PTOSC: { // Since pt-osc doesn't have a "liveness" plugin entry point, we do it externally: // if the process is alive, we update the `liveness_timestamp` for this migration. @@ -3612,7 +3627,7 @@ func (e *Executor) reviewRunningMigrations(ctx context.Context) (countRunnning i cancellable = append(cancellable, newCancellableMigration(uuid, message)) } } - case schema.DDLStrategyGhost: + case tabletmanagerdatapb.OnlineDDL_GHOST: { if _, ok := e.ownedRunningMigrations.Load(uuid); !ok { // Ummm, the migration is running but we don't own it. This means the migration @@ -3677,31 +3692,31 @@ func (e *Executor) reviewStaleMigrations(ctx context.Context) error { if err != nil { return err } - log.Infof("reviewStaleMigrations: stale migration found: %s", onlineDDL.UUID) - message := fmt.Sprintf("stale migration %s: found running but indicates no liveness in the past %v minutes", onlineDDL.UUID, staleMigrationMinutes) + log.Infof("reviewStaleMigrations: stale migration found: %s", onlineDDL.Uuid) + message := fmt.Sprintf("stale migration %s: found running but indicates no liveness in the past %v minutes", onlineDDL.Uuid, staleMigrationMinutes) if onlineDDL.TabletAlias != e.TabletAliasString() { // This means another tablet started the migration, and the migration has failed due to the tablet failure (e.g. primary failover) - if err := e.updateTabletFailure(ctx, onlineDDL.UUID); err != nil { + if err := e.updateTabletFailure(ctx, onlineDDL.Uuid); err != nil { return err } message = fmt.Sprintf("%s; executed by different tablet %s", message, onlineDDL.TabletAlias) } if _, err := e.terminateMigration(ctx, onlineDDL); err != nil { message = fmt.Sprintf("error terminating migration (%v): %v", message, err) - e.updateMigrationMessage(ctx, onlineDDL.UUID, message) + e.updateMigrationMessage(ctx, onlineDDL.Uuid, message) continue // we still want to handle rest of migrations } - if err := e.updateMigrationMessage(ctx, onlineDDL.UUID, message); err != nil { + if err := e.updateMigrationMessage(ctx, onlineDDL.Uuid, message); err != nil { return err } - if err := e.updateMigrationStatus(ctx, onlineDDL.UUID, schema.OnlineDDLStatusFailed); err != nil { + if err := e.updateMigrationStatus(ctx, onlineDDL.Uuid, tabletmanagerdatapb.OnlineDDL_FAILED); err != nil { return err } defer e.triggerNextCheckInterval() _ = e.updateMigrationStartedTimestamp(ctx, uuid) // Because the migration is stale, it may not update completed_timestamp. It is essential to set completed_timestamp // as this is then used when cleaning artifacts - if err := e.updateMigrationTimestamp(ctx, "completed_timestamp", onlineDDL.UUID); err != nil { + if err := e.updateMigrationTimestamp(ctx, "completed_timestamp", onlineDDL.Uuid); err != nil { return err } } @@ -4067,10 +4082,10 @@ func (e *Executor) updateMigrationStatusFailedOrCancelled(ctx context.Context, u return err } -func (e *Executor) updateMigrationStatus(ctx context.Context, uuid string, status schema.OnlineDDLStatus) error { - log.Infof("updateMigrationStatus: transitioning migration: %s into status: %s", uuid, string(status)) +func (e *Executor) updateMigrationStatus(ctx context.Context, uuid string, status tabletmanagerdatapb.OnlineDDL_Status) error { + log.Infof("updateMigrationStatus: transitioning migration: %s into status: %s", uuid, schema.OnlineDDLStatusName(status)) query, err := sqlparser.ParseAndBind(sqlUpdateMigrationStatus, - sqltypes.StringBindVariable(string(status)), + sqltypes.StringBindVariable(schema.OnlineDDLStatusName(status)), sqltypes.StringBindVariable(uuid), ) if err != nil { @@ -4303,12 +4318,7 @@ func (e *Executor) updateMigrationReadyToComplete(ctx context.Context, uuid stri } if val, ok := e.ownedRunningMigrations.Load(uuid); ok { if runningMigration, ok := val.(*schema.OnlineDDL); ok { - var storeValue int64 - if isReady { - storeValue = 1 - atomic.StoreInt64(&runningMigration.WasReadyToComplete, 1) // WasReadyToComplete is set once and never cleared - } - atomic.StoreInt64(&runningMigration.ReadyToComplete, storeValue) + runningMigration.MarkReady(isReady) } } return nil @@ -4630,12 +4640,12 @@ func (e *Executor) SubmitMigration( defer e.submitMutex.Unlock() // Is there already a migration by this same UUID? - storedMigration, _, err := e.readMigration(ctx, onlineDDL.UUID) + storedMigration, _, err := e.readMigration(ctx, onlineDDL.Uuid) if err != nil && err != ErrMigrationNotFound { - return nil, vterrors.Wrapf(err, "while checking whether migration %s exists", onlineDDL.UUID) + return nil, vterrors.Wrapf(err, "while checking whether migration %s exists", onlineDDL.Uuid) } if storedMigration != nil { - log.Infof("SubmitMigration: migration %s already exists with migration_context=%s, table=%s", onlineDDL.UUID, storedMigration.MigrationContext, onlineDDL.Table) + log.Infof("SubmitMigration: migration %s already exists with migration_context=%s, table=%s", onlineDDL.Uuid, storedMigration.MigrationContext, onlineDDL.Table) // A migration already exists with the same UUID. This is fine, we allow re-submitting migrations // with the same UUID, as we provide idempotency. // So we will _mostly_ ignore the request: we will not submit a new migration. However, we will do @@ -4644,13 +4654,13 @@ func (e *Executor) SubmitMigration( // 1. Check that the requested submmited migration macthes the existing one's migration-context, otherwise // this doesn't seem right, not the idempotency we were looking for if storedMigration.MigrationContext != onlineDDL.MigrationContext { - return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "migration rejected: found migration %s with different context: %s than submmitted migration's context: %s", onlineDDL.UUID, storedMigration.MigrationContext, onlineDDL.MigrationContext) + return nil, vterrors.Errorf(vtrpcpb.Code_FAILED_PRECONDITION, "migration rejected: found migration %s with different context: %s than submmitted migration's context: %s", onlineDDL.Uuid, storedMigration.MigrationContext, onlineDDL.MigrationContext) } // 2. Possibly, the existing migration is in 'failed' or 'cancelled' state, in which case this // resubmission should retry the migration. return e.submitCallbackIfNonConflicting( ctx, onlineDDL, - func() (*sqltypes.Result, error) { return e.RetryMigration(ctx, onlineDDL.UUID) }, + func() (*sqltypes.Result, error) { return e.RetryMigration(ctx, onlineDDL.Uuid) }, ) } @@ -4660,23 +4670,23 @@ func (e *Executor) SubmitMigration( if err != nil { return nil, err } - log.Infof("SubmitMigration: request to submit migration %s; action=%s, table=%s", onlineDDL.UUID, actionStr, onlineDDL.Table) + log.Infof("SubmitMigration: request to submit migration %s; action=%s, table=%s", onlineDDL.Uuid, actionStr, onlineDDL.Table) revertedUUID, _ := onlineDDL.GetRevertUUID() // Empty value if the migration is not actually a REVERT. Safe to ignore error. retainArtifactsSeconds := int64((retainOnlineDDLTables).Seconds()) _, allowConcurrentMigration := e.allowConcurrentMigration(onlineDDL) submitQuery, err := sqlparser.ParseAndBind(sqlInsertMigration, - sqltypes.StringBindVariable(onlineDDL.UUID), + sqltypes.StringBindVariable(onlineDDL.Uuid), sqltypes.StringBindVariable(e.keyspace), sqltypes.StringBindVariable(e.shard), sqltypes.StringBindVariable(e.dbName), sqltypes.StringBindVariable(onlineDDL.Table), - sqltypes.StringBindVariable(onlineDDL.SQL), - sqltypes.StringBindVariable(string(onlineDDL.Strategy)), + sqltypes.StringBindVariable(onlineDDL.Sql), + sqltypes.StringBindVariable(schema.OnlineDDLStrategyName(onlineDDL.Strategy)), sqltypes.StringBindVariable(onlineDDL.Options), sqltypes.StringBindVariable(actionStr), sqltypes.StringBindVariable(onlineDDL.MigrationContext), - sqltypes.StringBindVariable(string(schema.OnlineDDLStatusQueued)), + sqltypes.StringBindVariable(schema.OnlineDDLStatusName(tabletmanagerdatapb.OnlineDDL_QUEUED)), sqltypes.StringBindVariable(e.TabletAliasString()), sqltypes.Int64BindVariable(retainArtifactsSeconds), sqltypes.BoolBindVariable(onlineDDL.StrategySetting().IsPostponeLaunch()), @@ -4693,10 +4703,10 @@ func (e *Executor) SubmitMigration( func() (*sqltypes.Result, error) { return e.execQuery(ctx, submitQuery) }, ) if err != nil { - return nil, vterrors.Wrapf(err, "submitting migration %v", onlineDDL.UUID) + return nil, vterrors.Wrapf(err, "submitting migration %v", onlineDDL.Uuid) } - log.Infof("SubmitMigration: migration %s submitted", onlineDDL.UUID) + log.Infof("SubmitMigration: migration %s submitted", onlineDDL.Uuid) defer e.triggerNextCheckInterval() @@ -4763,28 +4773,28 @@ func (e *Executor) ShowMigrationLogs(ctx context.Context, stmt *sqlparser.ShowMi // onSchemaMigrationStatus is called when a status is set/changed for a running migration func (e *Executor) onSchemaMigrationStatus(ctx context.Context, - uuid string, status schema.OnlineDDLStatus, dryRun bool, progressPct float64, etaSeconds int64, rowsCopied int64, hint string) (err error) { - if dryRun && status != schema.OnlineDDLStatusFailed { + uuid string, status tabletmanagerdatapb.OnlineDDL_Status, dryRun bool, progressPct float64, etaSeconds int64, rowsCopied int64, hint string) (err error) { + if dryRun && status != tabletmanagerdatapb.OnlineDDL_FAILED { // We don't consider dry-run reports unless there's a failure return nil } switch status { - case schema.OnlineDDLStatusReady: + case tabletmanagerdatapb.OnlineDDL_READY: { err = e.updateMigrationTimestamp(ctx, "ready_timestamp", uuid) } - case schema.OnlineDDLStatusRunning: + case tabletmanagerdatapb.OnlineDDL_RUNNING: { _ = e.updateMigrationStartedTimestamp(ctx, uuid) err = e.updateMigrationTimestamp(ctx, "liveness_timestamp", uuid) } - case schema.OnlineDDLStatusComplete: + case tabletmanagerdatapb.OnlineDDL_COMPLETE: { progressPct = progressPctFull _ = e.updateMigrationStartedTimestamp(ctx, uuid) err = e.updateMigrationTimestamp(ctx, "completed_timestamp", uuid) } - case schema.OnlineDDLStatusFailed: + case tabletmanagerdatapb.OnlineDDL_FAILED: { _ = e.updateMigrationStartedTimestamp(ctx, uuid) err = e.updateMigrationTimestamp(ctx, "completed_timestamp", uuid) @@ -4812,7 +4822,7 @@ func (e *Executor) onSchemaMigrationStatus(ctx context.Context, } if !dryRun { switch status { - case schema.OnlineDDLStatusComplete, schema.OnlineDDLStatusFailed: + case tabletmanagerdatapb.OnlineDDL_COMPLETE, tabletmanagerdatapb.OnlineDDL_FAILED: e.triggerNextCheckInterval() } } @@ -4823,7 +4833,10 @@ func (e *Executor) onSchemaMigrationStatus(ctx context.Context, // OnSchemaMigrationStatus is called by TabletServer's API, which is invoked by a running gh-ost migration's hooks. func (e *Executor) OnSchemaMigrationStatus(ctx context.Context, uuidParam, statusParam, dryrunParam, progressParam, etaParam, rowsCopiedParam, hint string) (err error) { - status := schema.OnlineDDLStatus(statusParam) + status, err := schema.ParseOnlineDDLStatus(statusParam) + if err != nil { + return err + } dryRun := (dryrunParam == "true") var progressPct float64 if pct, err := strconv.ParseFloat(progressParam, 64); err == nil { diff --git a/go/vt/vttablet/onlineddl/executor_test.go b/go/vt/vttablet/onlineddl/executor_test.go index 08f363fc892..00b431301ca 100644 --- a/go/vt/vttablet/onlineddl/executor_test.go +++ b/go/vt/vttablet/onlineddl/executor_test.go @@ -29,6 +29,8 @@ import ( "vitess.io/vitess/go/vt/schema" "vitess.io/vitess/go/vt/sqlparser" + + tabletmanagerdatapb "vitess.io/vitess/go/vt/proto/tabletmanagerdata" ) func TestGetConstraintType(t *testing.T) { @@ -131,7 +133,13 @@ func TestValidateAndEditCreateTableStatement(t *testing.T) { createTable, ok := stmt.(*sqlparser.CreateTable) require.True(t, ok) - onlineDDL := &schema.OnlineDDL{UUID: "a5a563da_dc1a_11ec_a416_0a43f95f28a3", Table: "onlineddl_test", Options: tc.strategyOptions} + onlineDDL := &schema.OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Table: "onlineddl_test", + Options: tc.strategyOptions, + Uuid: "a5a563da_dc1a_11ec_a416_0a43f95f28a3", + }, + } constraintMap, err := e.validateAndEditCreateTableStatement(context.Background(), onlineDDL, createTable) if tc.expectError != "" { require.Error(t, err) @@ -217,7 +225,13 @@ func TestValidateAndEditAlterTableStatement(t *testing.T) { require.True(t, ok) m := map[string]string{} - onlineDDL := &schema.OnlineDDL{UUID: "a5a563da_dc1a_11ec_a416_0a43f95f28a3", Table: "t", Options: "--unsafe-allow-foreign-keys"} + onlineDDL := &schema.OnlineDDL{ + OnlineDDL: &tabletmanagerdatapb.OnlineDDL{ + Table: "t", + Options: "--unsafe-allow-foreign-keys", + Uuid: "a5a563da_dc1a_11ec_a416_0a43f95f28a3", + }, + } alters, err := e.validateAndEditAlterTableStatement(context.Background(), onlineDDL, alterTable, m) assert.NoError(t, err) altersStrings := []string{} diff --git a/go/vt/vttablet/tabletserver/query_executor.go b/go/vt/vttablet/tabletserver/query_executor.go index daf018cd4ed..dd8a1b16e2f 100644 --- a/go/vt/vttablet/tabletserver/query_executor.go +++ b/go/vt/vttablet/tabletserver/query_executor.go @@ -532,7 +532,7 @@ func (qre *QueryExecutor) execDDL(conn *StatefulConnection) (*sqltypes.Result, e // An Online DDL statement is identified by /*vt+ .. */ comment with expected directives, like uuid etc. if onlineDDL, err := schema.OnlineDDLFromCommentedStatement(qre.plan.FullStmt); err == nil { // Parsing is successful. - if !onlineDDL.Strategy.IsDirect() { + if !schema.NewDDLStrategySetting(onlineDDL.Strategy, onlineDDL.Options).IsDirect() { // This is an online DDL. return qre.tsv.onlineDDLExecutor.SubmitMigration(qre.ctx, qre.plan.FullStmt) } diff --git a/proto/tabletmanagerdata.proto b/proto/tabletmanagerdata.proto index ef6d5b68461..07f04c81c0d 100644 --- a/proto/tabletmanagerdata.proto +++ b/proto/tabletmanagerdata.proto @@ -34,6 +34,51 @@ import "vtrpc.proto"; // Data structures // +message OnlineDDL { + string keyspace = 1; + string table = 2; + string schema = 3; + string sql = 4; + string uuid = 5; + Strategy strategy = 6; + string options = 7; + string migration_context = 8; + Status status = 9; + topodata.TabletAlias tablet_alias = 10; + int64 retries = 11; + bool ready_to_complete = 12; + bool was_ready_to_complete = 13; + + enum Strategy { + option allow_alias = true; + // OnlineDDL_VITESS uses vreplication to run the OnlineDDL migration. It is + // the default strategy for OnlineDDL requests.option + // + // OnlineDDL_VITESS was also formerly called "ONLINE". + VITESS = 0; + ONLINE = 0; + GHOST = 1; + PTOSC = 2; + // OnlineDDL_DIRECT runs the migration directly against MySQL (e.g. `ALTER TABLE ...`), + // meaning it is not actually an "online" DDL migration. + DIRECT = 3; + // OnlineDDL_MYSQL is a managed migration (queued and executed by the + // scheduler) but runs through a MySQL `ALTER TABLE`. + MYSQL = 4; + } + + enum Status { + UNKNOWN = 0; + REQUESTED = 1; + CANCELLED = 2; + QUEUED = 3; + READY = 4; + RUNNING = 5; + COMPLETE = 6; + FAILED = 7; + } +} + // This structure allows us to manage tablet selection preferences // which are eventually passed to a TabletPicker. enum TabletSelectionPreference { diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 9061eb82477..3d1d21846df 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -16921,6 +16921,200 @@ export namespace topodata { /** Namespace tabletmanagerdata. */ export namespace tabletmanagerdata { + /** Properties of an OnlineDDL. */ + interface IOnlineDDL { + + /** OnlineDDL keyspace */ + keyspace?: (string|null); + + /** OnlineDDL table */ + table?: (string|null); + + /** OnlineDDL schema */ + schema?: (string|null); + + /** OnlineDDL sql */ + sql?: (string|null); + + /** OnlineDDL uuid */ + uuid?: (string|null); + + /** OnlineDDL strategy */ + strategy?: (tabletmanagerdata.OnlineDDL.Strategy|null); + + /** OnlineDDL options */ + options?: (string|null); + + /** OnlineDDL migration_context */ + migration_context?: (string|null); + + /** OnlineDDL status */ + status?: (tabletmanagerdata.OnlineDDL.Status|null); + + /** OnlineDDL tablet_alias */ + tablet_alias?: (topodata.ITabletAlias|null); + + /** OnlineDDL retries */ + retries?: (number|Long|null); + + /** OnlineDDL ready_to_complete */ + ready_to_complete?: (boolean|null); + + /** OnlineDDL was_ready_to_complete */ + was_ready_to_complete?: (boolean|null); + } + + /** Represents an OnlineDDL. */ + class OnlineDDL implements IOnlineDDL { + + /** + * Constructs a new OnlineDDL. + * @param [properties] Properties to set + */ + constructor(properties?: tabletmanagerdata.IOnlineDDL); + + /** OnlineDDL keyspace. */ + public keyspace: string; + + /** OnlineDDL table. */ + public table: string; + + /** OnlineDDL schema. */ + public schema: string; + + /** OnlineDDL sql. */ + public sql: string; + + /** OnlineDDL uuid. */ + public uuid: string; + + /** OnlineDDL strategy. */ + public strategy: tabletmanagerdata.OnlineDDL.Strategy; + + /** OnlineDDL options. */ + public options: string; + + /** OnlineDDL migration_context. */ + public migration_context: string; + + /** OnlineDDL status. */ + public status: tabletmanagerdata.OnlineDDL.Status; + + /** OnlineDDL tablet_alias. */ + public tablet_alias?: (topodata.ITabletAlias|null); + + /** OnlineDDL retries. */ + public retries: (number|Long); + + /** OnlineDDL ready_to_complete. */ + public ready_to_complete: boolean; + + /** OnlineDDL was_ready_to_complete. */ + public was_ready_to_complete: boolean; + + /** + * Creates a new OnlineDDL instance using the specified properties. + * @param [properties] Properties to set + * @returns OnlineDDL instance + */ + public static create(properties?: tabletmanagerdata.IOnlineDDL): tabletmanagerdata.OnlineDDL; + + /** + * Encodes the specified OnlineDDL message. Does not implicitly {@link tabletmanagerdata.OnlineDDL.verify|verify} messages. + * @param message OnlineDDL message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: tabletmanagerdata.IOnlineDDL, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OnlineDDL message, length delimited. Does not implicitly {@link tabletmanagerdata.OnlineDDL.verify|verify} messages. + * @param message OnlineDDL message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: tabletmanagerdata.IOnlineDDL, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OnlineDDL message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnlineDDL + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): tabletmanagerdata.OnlineDDL; + + /** + * Decodes an OnlineDDL message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnlineDDL + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): tabletmanagerdata.OnlineDDL; + + /** + * Verifies an OnlineDDL message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OnlineDDL message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnlineDDL + */ + public static fromObject(object: { [k: string]: any }): tabletmanagerdata.OnlineDDL; + + /** + * Creates a plain object from an OnlineDDL message. Also converts values to other types if specified. + * @param message OnlineDDL + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: tabletmanagerdata.OnlineDDL, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OnlineDDL to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OnlineDDL + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OnlineDDL { + + /** Strategy enum. */ + enum Strategy { + VITESS = 0, + ONLINE = 0, + GHOST = 1, + PTOSC = 2, + DIRECT = 3, + MYSQL = 4 + } + + /** Status enum. */ + enum Status { + UNKNOWN = 0, + REQUESTED = 1, + CANCELLED = 2, + QUEUED = 3, + READY = 4, + RUNNING = 5, + COMPLETE = 6, + FAILED = 7 + } + } + /** TabletSelectionPreference enum. */ enum TabletSelectionPreference { ANY = 0, diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index b640de318a7..365bfbddecc 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -39640,6 +39640,641 @@ export const tabletmanagerdata = $root.tabletmanagerdata = (() => { */ const tabletmanagerdata = {}; + tabletmanagerdata.OnlineDDL = (function() { + + /** + * Properties of an OnlineDDL. + * @memberof tabletmanagerdata + * @interface IOnlineDDL + * @property {string|null} [keyspace] OnlineDDL keyspace + * @property {string|null} [table] OnlineDDL table + * @property {string|null} [schema] OnlineDDL schema + * @property {string|null} [sql] OnlineDDL sql + * @property {string|null} [uuid] OnlineDDL uuid + * @property {tabletmanagerdata.OnlineDDL.Strategy|null} [strategy] OnlineDDL strategy + * @property {string|null} [options] OnlineDDL options + * @property {string|null} [migration_context] OnlineDDL migration_context + * @property {tabletmanagerdata.OnlineDDL.Status|null} [status] OnlineDDL status + * @property {topodata.ITabletAlias|null} [tablet_alias] OnlineDDL tablet_alias + * @property {number|Long|null} [retries] OnlineDDL retries + * @property {boolean|null} [ready_to_complete] OnlineDDL ready_to_complete + * @property {boolean|null} [was_ready_to_complete] OnlineDDL was_ready_to_complete + */ + + /** + * Constructs a new OnlineDDL. + * @memberof tabletmanagerdata + * @classdesc Represents an OnlineDDL. + * @implements IOnlineDDL + * @constructor + * @param {tabletmanagerdata.IOnlineDDL=} [properties] Properties to set + */ + function OnlineDDL(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OnlineDDL keyspace. + * @member {string} keyspace + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.keyspace = ""; + + /** + * OnlineDDL table. + * @member {string} table + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.table = ""; + + /** + * OnlineDDL schema. + * @member {string} schema + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.schema = ""; + + /** + * OnlineDDL sql. + * @member {string} sql + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.sql = ""; + + /** + * OnlineDDL uuid. + * @member {string} uuid + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.uuid = ""; + + /** + * OnlineDDL strategy. + * @member {tabletmanagerdata.OnlineDDL.Strategy} strategy + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.strategy = 0; + + /** + * OnlineDDL options. + * @member {string} options + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.options = ""; + + /** + * OnlineDDL migration_context. + * @member {string} migration_context + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.migration_context = ""; + + /** + * OnlineDDL status. + * @member {tabletmanagerdata.OnlineDDL.Status} status + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.status = 0; + + /** + * OnlineDDL tablet_alias. + * @member {topodata.ITabletAlias|null|undefined} tablet_alias + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.tablet_alias = null; + + /** + * OnlineDDL retries. + * @member {number|Long} retries + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.retries = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * OnlineDDL ready_to_complete. + * @member {boolean} ready_to_complete + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.ready_to_complete = false; + + /** + * OnlineDDL was_ready_to_complete. + * @member {boolean} was_ready_to_complete + * @memberof tabletmanagerdata.OnlineDDL + * @instance + */ + OnlineDDL.prototype.was_ready_to_complete = false; + + /** + * Creates a new OnlineDDL instance using the specified properties. + * @function create + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {tabletmanagerdata.IOnlineDDL=} [properties] Properties to set + * @returns {tabletmanagerdata.OnlineDDL} OnlineDDL instance + */ + OnlineDDL.create = function create(properties) { + return new OnlineDDL(properties); + }; + + /** + * Encodes the specified OnlineDDL message. Does not implicitly {@link tabletmanagerdata.OnlineDDL.verify|verify} messages. + * @function encode + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {tabletmanagerdata.IOnlineDDL} message OnlineDDL message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnlineDDL.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyspace != null && Object.hasOwnProperty.call(message, "keyspace")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyspace); + if (message.table != null && Object.hasOwnProperty.call(message, "table")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.table); + if (message.schema != null && Object.hasOwnProperty.call(message, "schema")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.schema); + if (message.sql != null && Object.hasOwnProperty.call(message, "sql")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sql); + if (message.uuid != null && Object.hasOwnProperty.call(message, "uuid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.uuid); + if (message.strategy != null && Object.hasOwnProperty.call(message, "strategy")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.strategy); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.options); + if (message.migration_context != null && Object.hasOwnProperty.call(message, "migration_context")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.migration_context); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.status); + if (message.tablet_alias != null && Object.hasOwnProperty.call(message, "tablet_alias")) + $root.topodata.TabletAlias.encode(message.tablet_alias, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.retries != null && Object.hasOwnProperty.call(message, "retries")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.retries); + if (message.ready_to_complete != null && Object.hasOwnProperty.call(message, "ready_to_complete")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.ready_to_complete); + if (message.was_ready_to_complete != null && Object.hasOwnProperty.call(message, "was_ready_to_complete")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.was_ready_to_complete); + return writer; + }; + + /** + * Encodes the specified OnlineDDL message, length delimited. Does not implicitly {@link tabletmanagerdata.OnlineDDL.verify|verify} messages. + * @function encodeDelimited + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {tabletmanagerdata.IOnlineDDL} message OnlineDDL message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnlineDDL.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OnlineDDL message from the specified reader or buffer. + * @function decode + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {tabletmanagerdata.OnlineDDL} OnlineDDL + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnlineDDL.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.tabletmanagerdata.OnlineDDL(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.keyspace = reader.string(); + break; + } + case 2: { + message.table = reader.string(); + break; + } + case 3: { + message.schema = reader.string(); + break; + } + case 4: { + message.sql = reader.string(); + break; + } + case 5: { + message.uuid = reader.string(); + break; + } + case 6: { + message.strategy = reader.int32(); + break; + } + case 7: { + message.options = reader.string(); + break; + } + case 8: { + message.migration_context = reader.string(); + break; + } + case 9: { + message.status = reader.int32(); + break; + } + case 10: { + message.tablet_alias = $root.topodata.TabletAlias.decode(reader, reader.uint32()); + break; + } + case 11: { + message.retries = reader.int64(); + break; + } + case 12: { + message.ready_to_complete = reader.bool(); + break; + } + case 13: { + message.was_ready_to_complete = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OnlineDDL message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {tabletmanagerdata.OnlineDDL} OnlineDDL + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnlineDDL.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OnlineDDL message. + * @function verify + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnlineDDL.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyspace != null && message.hasOwnProperty("keyspace")) + if (!$util.isString(message.keyspace)) + return "keyspace: string expected"; + if (message.table != null && message.hasOwnProperty("table")) + if (!$util.isString(message.table)) + return "table: string expected"; + if (message.schema != null && message.hasOwnProperty("schema")) + if (!$util.isString(message.schema)) + return "schema: string expected"; + if (message.sql != null && message.hasOwnProperty("sql")) + if (!$util.isString(message.sql)) + return "sql: string expected"; + if (message.uuid != null && message.hasOwnProperty("uuid")) + if (!$util.isString(message.uuid)) + return "uuid: string expected"; + if (message.strategy != null && message.hasOwnProperty("strategy")) + switch (message.strategy) { + default: + return "strategy: enum value expected"; + case 0: + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.options != null && message.hasOwnProperty("options")) + if (!$util.isString(message.options)) + return "options: string expected"; + if (message.migration_context != null && message.hasOwnProperty("migration_context")) + if (!$util.isString(message.migration_context)) + return "migration_context: string expected"; + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) { + let error = $root.topodata.TabletAlias.verify(message.tablet_alias); + if (error) + return "tablet_alias." + error; + } + if (message.retries != null && message.hasOwnProperty("retries")) + if (!$util.isInteger(message.retries) && !(message.retries && $util.isInteger(message.retries.low) && $util.isInteger(message.retries.high))) + return "retries: integer|Long expected"; + if (message.ready_to_complete != null && message.hasOwnProperty("ready_to_complete")) + if (typeof message.ready_to_complete !== "boolean") + return "ready_to_complete: boolean expected"; + if (message.was_ready_to_complete != null && message.hasOwnProperty("was_ready_to_complete")) + if (typeof message.was_ready_to_complete !== "boolean") + return "was_ready_to_complete: boolean expected"; + return null; + }; + + /** + * Creates an OnlineDDL message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {Object.} object Plain object + * @returns {tabletmanagerdata.OnlineDDL} OnlineDDL + */ + OnlineDDL.fromObject = function fromObject(object) { + if (object instanceof $root.tabletmanagerdata.OnlineDDL) + return object; + let message = new $root.tabletmanagerdata.OnlineDDL(); + if (object.keyspace != null) + message.keyspace = String(object.keyspace); + if (object.table != null) + message.table = String(object.table); + if (object.schema != null) + message.schema = String(object.schema); + if (object.sql != null) + message.sql = String(object.sql); + if (object.uuid != null) + message.uuid = String(object.uuid); + switch (object.strategy) { + default: + if (typeof object.strategy === "number") { + message.strategy = object.strategy; + break; + } + break; + case "VITESS": + case 0: + message.strategy = 0; + break; + case "ONLINE": + case 0: + message.strategy = 0; + break; + case "GHOST": + case 1: + message.strategy = 1; + break; + case "PTOSC": + case 2: + message.strategy = 2; + break; + case "DIRECT": + case 3: + message.strategy = 3; + break; + case "MYSQL": + case 4: + message.strategy = 4; + break; + } + if (object.options != null) + message.options = String(object.options); + if (object.migration_context != null) + message.migration_context = String(object.migration_context); + switch (object.status) { + default: + if (typeof object.status === "number") { + message.status = object.status; + break; + } + break; + case "UNKNOWN": + case 0: + message.status = 0; + break; + case "REQUESTED": + case 1: + message.status = 1; + break; + case "CANCELLED": + case 2: + message.status = 2; + break; + case "QUEUED": + case 3: + message.status = 3; + break; + case "READY": + case 4: + message.status = 4; + break; + case "RUNNING": + case 5: + message.status = 5; + break; + case "COMPLETE": + case 6: + message.status = 6; + break; + case "FAILED": + case 7: + message.status = 7; + break; + } + if (object.tablet_alias != null) { + if (typeof object.tablet_alias !== "object") + throw TypeError(".tabletmanagerdata.OnlineDDL.tablet_alias: object expected"); + message.tablet_alias = $root.topodata.TabletAlias.fromObject(object.tablet_alias); + } + if (object.retries != null) + if ($util.Long) + (message.retries = $util.Long.fromValue(object.retries)).unsigned = false; + else if (typeof object.retries === "string") + message.retries = parseInt(object.retries, 10); + else if (typeof object.retries === "number") + message.retries = object.retries; + else if (typeof object.retries === "object") + message.retries = new $util.LongBits(object.retries.low >>> 0, object.retries.high >>> 0).toNumber(); + if (object.ready_to_complete != null) + message.ready_to_complete = Boolean(object.ready_to_complete); + if (object.was_ready_to_complete != null) + message.was_ready_to_complete = Boolean(object.was_ready_to_complete); + return message; + }; + + /** + * Creates a plain object from an OnlineDDL message. Also converts values to other types if specified. + * @function toObject + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {tabletmanagerdata.OnlineDDL} message OnlineDDL + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnlineDDL.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.keyspace = ""; + object.table = ""; + object.schema = ""; + object.sql = ""; + object.uuid = ""; + object.strategy = options.enums === String ? "VITESS" : 0; + object.options = ""; + object.migration_context = ""; + object.status = options.enums === String ? "UNKNOWN" : 0; + object.tablet_alias = null; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.retries = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.retries = options.longs === String ? "0" : 0; + object.ready_to_complete = false; + object.was_ready_to_complete = false; + } + if (message.keyspace != null && message.hasOwnProperty("keyspace")) + object.keyspace = message.keyspace; + if (message.table != null && message.hasOwnProperty("table")) + object.table = message.table; + if (message.schema != null && message.hasOwnProperty("schema")) + object.schema = message.schema; + if (message.sql != null && message.hasOwnProperty("sql")) + object.sql = message.sql; + if (message.uuid != null && message.hasOwnProperty("uuid")) + object.uuid = message.uuid; + if (message.strategy != null && message.hasOwnProperty("strategy")) + object.strategy = options.enums === String ? $root.tabletmanagerdata.OnlineDDL.Strategy[message.strategy] === undefined ? message.strategy : $root.tabletmanagerdata.OnlineDDL.Strategy[message.strategy] : message.strategy; + if (message.options != null && message.hasOwnProperty("options")) + object.options = message.options; + if (message.migration_context != null && message.hasOwnProperty("migration_context")) + object.migration_context = message.migration_context; + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.tabletmanagerdata.OnlineDDL.Status[message.status] === undefined ? message.status : $root.tabletmanagerdata.OnlineDDL.Status[message.status] : message.status; + if (message.tablet_alias != null && message.hasOwnProperty("tablet_alias")) + object.tablet_alias = $root.topodata.TabletAlias.toObject(message.tablet_alias, options); + if (message.retries != null && message.hasOwnProperty("retries")) + if (typeof message.retries === "number") + object.retries = options.longs === String ? String(message.retries) : message.retries; + else + object.retries = options.longs === String ? $util.Long.prototype.toString.call(message.retries) : options.longs === Number ? new $util.LongBits(message.retries.low >>> 0, message.retries.high >>> 0).toNumber() : message.retries; + if (message.ready_to_complete != null && message.hasOwnProperty("ready_to_complete")) + object.ready_to_complete = message.ready_to_complete; + if (message.was_ready_to_complete != null && message.hasOwnProperty("was_ready_to_complete")) + object.was_ready_to_complete = message.was_ready_to_complete; + return object; + }; + + /** + * Converts this OnlineDDL to JSON. + * @function toJSON + * @memberof tabletmanagerdata.OnlineDDL + * @instance + * @returns {Object.} JSON object + */ + OnlineDDL.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OnlineDDL + * @function getTypeUrl + * @memberof tabletmanagerdata.OnlineDDL + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnlineDDL.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/tabletmanagerdata.OnlineDDL"; + }; + + /** + * Strategy enum. + * @name tabletmanagerdata.OnlineDDL.Strategy + * @enum {number} + * @property {number} VITESS=0 VITESS value + * @property {number} ONLINE=0 ONLINE value + * @property {number} GHOST=1 GHOST value + * @property {number} PTOSC=2 PTOSC value + * @property {number} DIRECT=3 DIRECT value + * @property {number} MYSQL=4 MYSQL value + */ + OnlineDDL.Strategy = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VITESS"] = 0; + values["ONLINE"] = 0; + values[valuesById[1] = "GHOST"] = 1; + values[valuesById[2] = "PTOSC"] = 2; + values[valuesById[3] = "DIRECT"] = 3; + values[valuesById[4] = "MYSQL"] = 4; + return values; + })(); + + /** + * Status enum. + * @name tabletmanagerdata.OnlineDDL.Status + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} REQUESTED=1 REQUESTED value + * @property {number} CANCELLED=2 CANCELLED value + * @property {number} QUEUED=3 QUEUED value + * @property {number} READY=4 READY value + * @property {number} RUNNING=5 RUNNING value + * @property {number} COMPLETE=6 COMPLETE value + * @property {number} FAILED=7 FAILED value + */ + OnlineDDL.Status = (function() { + const valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "REQUESTED"] = 1; + values[valuesById[2] = "CANCELLED"] = 2; + values[valuesById[3] = "QUEUED"] = 3; + values[valuesById[4] = "READY"] = 4; + values[valuesById[5] = "RUNNING"] = 5; + values[valuesById[6] = "COMPLETE"] = 6; + values[valuesById[7] = "FAILED"] = 7; + return values; + })(); + + return OnlineDDL; + })(); + /** * TabletSelectionPreference enum. * @name tabletmanagerdata.TabletSelectionPreference