feat: 工单执行集成gh-ost通道 + Dockerfile安装gh-ost + 密码解密修复
- ExecuteTicket: 检测 ghost_enabled + ALTER TABLE → 走 gh-ost 同步执行 - parseAlterTable: 解析 ALTER TABLE 提取表名和 alter 子句(支持反引号/db.table) - buildGhOstTask: 修复密码传递(加密→解密后传给 gh-ost 命令行) - Dockerfile: 运行阶段下载 gh-ost v1.1.6 Linux amd64 二进制 - ghost_enabled=false 默认关闭,工单流程正常走普通通道 - 端到端验证: ALTER TABLE+ghost_enabled=true → gh-ost; INSERT/关闭 → 普通
This commit is contained in:
1 parent
bc2092a980
commit
b2b689f791
3 files changed
+96
-2
No files matched your search
@@ -353,11 +353,17 @@ func buildGhOstTask(instanceID int, database, table, alter string) (*ghost.GhOst
|
||||
return nil, fmt.Errorf("gh-ost only supports MySQL instances, got %s", inst.DBType)
|
||||
}
|
||||
|
||||
// Decrypt password for gh-ost command line
|
||||
password := inst.Password
|
||||
if dec, err := decryptPassword(strings.TrimPrefix(inst.Password, "enc:")); err == nil {
|
||||
password = dec
|
||||
}
|
||||
|
||||
task := &ghost.GhOstTask{
|
||||
Host: inst.Host,
|
||||
Port: inst.Port,
|
||||
User: inst.Username,
|
||||
Password: inst.Password,
|
||||
Password: password,
|
||||
Database: database,
|
||||
Table: table,
|
||||
Alter: alter,
|
||||
|
||||
Reference in new issue
Block a user