From 67bd0f0e1c237ed2ea9b06d03e03ff3b49277474 Mon Sep 17 00:00:00 2001 From: yuanruji Date: Mon, 23 Sep 2024 10:54:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(backend):=20mysql=E9=85=8D=E7=BD=AElog=5Fer?= =?UTF-8?q?ror=5Fverbosity=E8=BD=AC=E6=88=90=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=EF=BC=8C=E5=90=A6=E5=88=99=E4=BC=9A=E5=8F=8D=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E5=A4=B1=E8=B4=A5=20#7068?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/utils/mysql/mysql_act_playload.py | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py index b9faa88f29..24fa33ce10 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -137,12 +137,33 @@ def deal_mysql_config(self, db_version: str, origin_configs: dict, init_configs: if "log_warnings" in cfg["mysqld"]: value = cfg["mysqld"]["log_warnings"] if value == "0": - cfg["mysqld"]["log_error_verbosity"] = 1 + cfg["mysqld"]["log_error_verbosity"] = "1" elif value == "1": - cfg["mysqld"]["log_error_verbosity"] = 2 + cfg["mysqld"]["log_error_verbosity"] = "2" else: - cfg["mysqld"]["log_error_verbosity"] = 3 + cfg["mysqld"]["log_error_verbosity"] = "3" del cfg["mysqld"]["log_warnings"] + # mysql8.0 无法识别这些参数 + for key in [ + "innodb_file_format", + "query_cache_size", + "query_cache_type", + "show_compatibility_56", + "query_response_time_stats", + "userstat", + ]: + if key in cfg["mysqld"]: + del cfg["mysqld"][key] + if "thread_handling" in cfg["mysqld"]: + val = cfg["mysqld"]["thread_handling"] + # thread_handling = 2 是tmysql参数。社区版本和txsql 都不能识别 + if val == "1": + cfg["mysqld"]["thread_handling"] = "no-threads" + elif val == "2": + cfg["mysqld"]["thread_handling"] = "one-thread-per-connection" + elif val == "3": + cfg["mysqld"]["thread_handling"] = "loaded-dynamically" + # 这里应该是社区版本等非Tendb数据库的版本需要处理的参数 # 介质管理暂未记录介质来源属性 if db_version >= "8.0.30":