Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

refactor: remove drop original table executor (#1955)

Yilong Li6e3d70e1874b
diff --git a/api/task.go b/api/task.go
index fe5d749170..6b5f821340 100644
--- a/api/task.go
+++ b/api/task.go
@@ -48,8 +48,6 @@ const (
TaskDatabaseSchemaUpdateGhostSync TaskType = "bb.task.database.schema.update.ghost.sync"
// TaskDatabaseSchemaUpdateGhostCutover is the task type for gh-ost switching the original table and the ghost table.
TaskDatabaseSchemaUpdateGhostCutover TaskType = "bb.task.database.schema.update.ghost.cutover"
- // TaskDatabaseSchemaUpdateGhostDropOriginalTable is the task type for dropping the original table.
- TaskDatabaseSchemaUpdateGhostDropOriginalTable TaskType = "bb.task.database.schema.update.ghost.drop-original-table"
// TaskDatabaseDataUpdate is the task type for updating database data.
TaskDatabaseDataUpdate TaskType = "bb.task.database.data.update"
// TaskDatabaseBackup is the task type for creating database backups.
@@ -114,13 +112,6 @@ type TaskDatabaseSchemaUpdateGhostSyncPayload struct {
type TaskDatabaseSchemaUpdateGhostCutoverPayload struct {
}
-// TaskDatabaseSchemaUpdateGhostDropOriginalTablePayload is the task type for dropping the original table
-type TaskDatabaseSchemaUpdateGhostDropOriginalTablePayload struct {
- DatabaseName string `json:"databaseName,omitempty"`
- // TableName is like `_tablename_del`.
- TableName string `json:"tableName,omitempty"`
-}
-
// TaskDatabaseDataUpdatePayload is the task payload for database data update (DML).
type TaskDatabaseDataUpdatePayload struct {
Statement string `json:"statement,omitempty"`
diff --git a/frontend/src/components/Issue/logic/common.ts b/frontend/src/components/Issue/logic/common.ts
index 637d0f7387..70e2920e1a 100644
--- a/frontend/src/components/Issue/logic/common.ts
+++ b/frontend/src/components/Issue/logic/common.ts
@@ -290,7 +290,6 @@ const statementOfTask = (task: Task) => {
return "";
case "bb.task.database.schema.update.ghost.sync":
case "bb.task.database.schema.update.ghost.cutover":
- case "bb.task.database.schema.update.ghost.drop-original-table":
return ""; // should never reach here
}
};
diff --git a/frontend/src/types/pipeline/task.ts b/frontend/src/types/pipeline/task.ts
index b0f2466f84..1f688b20ff 100644
--- a/frontend/src/types/pipeline/task.ts
+++ b/frontend/src/types/pipeline/task.ts
@@ -22,7 +22,6 @@ export type TaskType =
| "bb.task.database.restore"
| "bb.task.database.schema.update.ghost.sync"
| "bb.task.database.schema.update.ghost.cutover"
- | "bb.task.database.schema.update.ghost.drop-original-table"
| "bb.task.database.pitr.restore"
| "bb.task.database.pitr.cutover"
| "bb.task.database.pitr.delete";
@@ -67,11 +66,6 @@ export type TaskDatabaseSchemaUpdateGhostCutoverPayload = {
// more input and output parameters in the future
};
-export type TaskDatabaseSchemaUpdateGhostDropOriginalTablePayload = {
- databaseName: string;
- tableName: string;
-};
-
export type TaskDatabasePITRRestorePayload = {
projectId: ProjectId;
pointInTimeTs: number; // UNIX timestamp
@@ -103,7 +97,6 @@ export type TaskPayload =
| TaskDatabaseSchemaUpdatePayload
| TaskDatabaseSchemaUpdateGhostSyncPayload
| TaskDatabaseSchemaUpdateGhostCutoverPayload
- | TaskDatabaseSchemaUpdateGhostDropOriginalTablePayload
| TaskDatabaseDataUpdatePayload
| TaskDatabaseRestorePayload
| TaskEarliestAllowedTimePayload
diff --git a/server/server.go b/server/server.go
index c843c01bf4..af5545507f 100644
--- a/server/server.go
+++ b/server/server.go
@@ -224,9 +224,6 @@ func NewServer(ctx context.Context, prof Profile) (*Server, error) {
schemaUpdateGhostCutoverExecutor := NewSchemaUpdateGhostCutoverTaskExecutor()
taskScheduler.Register(api.TaskDatabaseSchemaUpdateGhostCutover, schemaUpdateGhostCutoverExecutor)
- schemaUpdateGhostDropOriginalTableExecutor := NewSchemaUpdateGhostDropOriginalTableTaskExecutor()
- taskScheduler.Register(api.TaskDatabaseSchemaUpdateGhostDropOriginalTable, schemaUpdateGhostDropOriginalTableExecutor)
-
pitrRestoreExecutor := NewPITRRestoreTaskExecutor(s.mysqlutil)
taskScheduler.Register(api.TaskDatabasePITRRestore, pitrRestoreExecutor)
diff --git a/server/task_executor_schema_update_ghost_drop_original_table.go b/server/task_executor_schema_update_ghost_drop_original_table.go
deleted file mode 100644
index 3289a18d27..0000000000
--- a/server/task_executor_schema_update_ghost_drop_original_table.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package server
-
-import (
- "context"
-
- "github.com/bytebase/bytebase/api"
-)
-
-// NewSchemaUpdateGhostDropOriginalTableTaskExecutor creates a schema update (gh-ost) drop original table task executor.
-func NewSchemaUpdateGhostDropOriginalTableTaskExecutor() TaskExecutor {
- return &SchemaUpdateGhostDropOriginalTableTaskExecutor{}
-}
-
-// SchemaUpdateGhostDropOriginalTableTaskExecutor is the schema update (gh-ost) drop original table task executor.
-type SchemaUpdateGhostDropOriginalTableTaskExecutor struct {
-}
-
-// RunOnce will run SchemaUpdateGhostDropOriginalTable task once.
-func (exec *SchemaUpdateGhostDropOriginalTableTaskExecutor) RunOnce(ctx context.Context, server *Server, task *api.Task) (terminated bool, result *api.TaskRunResultPayload, err error) {
- return true, &api.TaskRunResultPayload{Detail: "not implemented yet"}, nil
-}