Skip to content

Commit

Permalink
feat: 数据恢复flow时区兼容 #2676
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo authored and zhangzhw8 committed Dec 20, 2023
1 parent f61c2f5 commit b347241
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from backend.components import DRSApi
from backend.db_meta.models import Cluster
from backend.flow.utils.mysql.common.compare_time import compare_time
from backend.utils.time import compare_time

logger = logging.getLogger("root")

Expand Down Expand Up @@ -39,7 +39,7 @@ def get_local_backup(instances: list, cluster: Cluster):
backups.append(backup_tmp)

# 多份备份比较 backup map 列表....
backup_time = "2000-01-01 00:00:00"
backup_time = "1999-01-01T11:11:11+08:00"
if len(backups) > 0:
max_backup = backups[0]
for backup in backups:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
from backend.flow.plugins.components.collections.mysql.mysql_download_backupfile import (
MySQLDownloadBackupfileComponent,
)
from backend.flow.utils.mysql.common.compare_time import compare_time
from backend.flow.utils.mysql.mysql_act_dataclass import DownloadBackupFileKwargs, ExecActuatorKwargs
from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload
from backend.utils.time import str2datetime
from backend.utils.time import compare_time, str2datetime


def spider_recover_sub_flow(root_id: str, ticket_data: dict, cluster: dict):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pipeline.component_framework.component import Component

from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileService
from backend.flow.utils.mysql.common.compare_time import compare_time
from backend.utils.time import compare_time

logger = logging.getLogger("flow")

Expand All @@ -35,7 +35,7 @@ def _execute(self, data, parent_data) -> bool:

backup_infos = {**trans_data.master_backup_file["backups"], **trans_data.slave_backup_file["backups"]}
backup_info = {}
backup_time = "2000-01-01 00:00:00"
backup_time = "1999-01-01T11:11:11+08:00"
rollback_time = one_cluster["rollback_time"]
for key, value in backup_infos.items():
if str(value["data_schema_grant"]).lower() == "all" or (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
from pipeline.component_framework.component import Component

from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileService
from backend.flow.utils.mysql.common.compare_time import compare_time
from backend.ticket.constants import TicketType
from backend.utils.time import compare_time

logger = logging.getLogger("flow")

Expand All @@ -36,7 +36,7 @@ def _execute(self, data, parent_data) -> bool:
trans_data = data.get_one_of_inputs("trans_data")

# 获取备份文件,并找出最
backup_time = "2000-01-01 00:00:00"
backup_time = "1999-01-01T11:11:11+08:00"
backup_file = {}
if global_data["ticket_type"] in (TicketType.MYSQL_RESTORE_LOCAL_SLAVE.value,):
self.log_error(_("仅在主库查找备份源"))
Expand Down
18 changes: 0 additions & 18 deletions dbm-ui/backend/flow/utils/mysql/common/compare_time.py

This file was deleted.

0 comments on commit b347241

Please sign in to comment.