Skip to content

Commit

Permalink
fix(redis): 数据复制任务 ID 统一 #1413
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemakeit authored and gaohongsong committed Oct 17, 2023
1 parent 2984b1f commit c306fc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (job *RedisBackup) GetBackupClient() (err error) {
bkTag = consts.RedisForeverBackupTAG
}
// job.backupClient = backupsys.NewIBSBackupClient(consts.IBSBackupClient, bkTag)
job.backupClient, err = backupsys.NewCosBackupClient(consts.COSBackupClient, "", bkTag)
job.backupClient, err = backupsys.NewCosBackupClient(consts.COSBackupClient, consts.COSInfoFile, bkTag)
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ const (
ForeverBackupType = "forever_backup"
IBSBackupClient = "/usr/local/bin/backup_client"
COSBackupClient = "/usr/local/backup_client/bin/backup_client"
COSInfoFile = "/home/mysql/.cosinfo.toml"
BackupTarSplitSize = "8G"
RedisFullBackupTAG = "REDIS_FULL"
RedisBinlogTAG = "REDIS_BINLOG"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"""
import base64
import datetime
import hashlib
import logging
import re
import traceback
Expand Down Expand Up @@ -855,7 +854,7 @@ def __new_data_check_repair_job(self, global_data: dict, dts_job: TbTendisDTSJob
],
}
self.log_info(f"new_data_check_repair_job ticket_data:{ticket_data}")
root_id = uuid.uuid1().hex
root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "")
flow = RedisClusterDataCheckRepairFlow(root_id=root_id, data=ticket_data)
flow.redis_cluster_data_check_repair_flow()
self.log_info(f"new_data_check_repair_job flow_id:{root_id}")
Expand Down Expand Up @@ -919,7 +918,7 @@ def _execute(self, data, parent_data):
"resource_spec": kwargs["cluster"]["dst_install_param"]["resource_spec"],
}
self.log_info("NewDstClusterInstallJobAndWatchStatus ticket_data==>:{}".format(ticket_data))
root_id = uuid.uuid1().hex
root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "")
if ticket_data["cluster_type"] == ClusterType.TendisPredixyTendisplusCluster.value:
flow = TendisPlusApplyFlow(root_id=root_id, data=ticket_data)
flow.deploy_tendisplus_cluster_flow()
Expand Down Expand Up @@ -1021,7 +1020,7 @@ def _execute(self, data, parent_data):
],
}
self.log_info("NewDstClusterFlushJobAndWatchStatus ticket_data==>:{}".format(ticket_data))
root_id = uuid.uuid1().hex
root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "")
flow = RedisFlushDataFlow(root_id=root_id, data=ticket_data)
flow.redis_flush_data_flow()

Expand Down Expand Up @@ -1115,7 +1114,7 @@ def _execute(self, data, parent_data):
self.log_info(f"new_dts_online_switch_job ticket_data:{ticket_data}")
from backend.flow.engine.bamboo.scene.redis.redis_cluster_data_copy import RedisClusterDataCopyFlow

root_id = uuid.uuid1().hex
root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "")
flow = RedisClusterDataCopyFlow(root_id=root_id, data=ticket_data)
flow.online_switch_flow()

Expand Down Expand Up @@ -1317,7 +1316,7 @@ def _execute(self, data, parent_data):
"force": False,
}
self.log_info(f"redis_cluster_close dst_cluster:{job_row.dst_cluster} ticket_data:{ticket_data}")
root_id = uuid.uuid1().hex
root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "")
flow = RedisClusterOpenCloseFlow(root_id=root_id, data=ticket_data)
flow.redis_cluster_open_close_flow()

Expand Down Expand Up @@ -1410,7 +1409,7 @@ def _execute(self, data, parent_data):
"cluster_id": job_row.dst_cluster_id,
}
self.log_info(f"redis_cluster_shutdown ticket_data:{ticket_data}")
root_id = uuid.uuid1().hex
root_id = f"{datetime.date.today()}{uuid.uuid1().hex[:6]}".replace("-", "")
flow = RedisClusterShutdownFlow(root_id=root_id, data=ticket_data)
flow.redis_cluster_shutdown_flow()

Expand Down

0 comments on commit c306fc4

Please sign in to comment.