From 4f4ee079bb85cf82e431e3fc4bef3d84795d83be Mon Sep 17 00:00:00 2001 From: Rongfeng Fu Date: Wed, 7 Dec 2022 16:27:26 +0800 Subject: [PATCH] V1.6.2 (#148) --- executer27-requirements.txt | 2 ++ optimize/oceanbase-ce/4.0.0.0/tpch.yaml | 4 ---- optimize/oceanbase/4.0.0.0/tpch.yaml | 4 ---- plugins/grafana/7.5.17/init.py | 5 +++-- plugins/oceanbase/3.1.0/start_check.py | 5 ++--- plugins/oceanbase/3.1.0/upgrade_route.py | 4 ++++ plugins/oceanbase/4.0.0.0/parameter.yaml | 2 +- plugins/oceanbase/4.0.0.0/start_check.py | 4 ++-- profile/obd.sh | 5 +++-- 9 files changed, 17 insertions(+), 18 deletions(-) create mode 100644 executer27-requirements.txt diff --git a/executer27-requirements.txt b/executer27-requirements.txt new file mode 100644 index 0000000..bc7364e --- /dev/null +++ b/executer27-requirements.txt @@ -0,0 +1,2 @@ +protobuf==3.18.0 +mysql-connector-python==8.0.21 diff --git a/optimize/oceanbase-ce/4.0.0.0/tpch.yaml b/optimize/oceanbase-ce/4.0.0.0/tpch.yaml index d29b066..6345ba4 100644 --- a/optimize/oceanbase-ce/4.0.0.0/tpch.yaml +++ b/optimize/oceanbase-ce/4.0.0.0/tpch.yaml @@ -69,10 +69,6 @@ test: variables: - name: ob_sql_work_area_percentage value: 80 - - name: optimizer_use_sql_plan_baselines - value: true - - name: optimizer_capture_sql_plan_baselines - value: true - name: ob_query_timeout value: 36000000000 - name: ob_trx_timeout diff --git a/optimize/oceanbase/4.0.0.0/tpch.yaml b/optimize/oceanbase/4.0.0.0/tpch.yaml index d29b066..6345ba4 100644 --- a/optimize/oceanbase/4.0.0.0/tpch.yaml +++ b/optimize/oceanbase/4.0.0.0/tpch.yaml @@ -69,10 +69,6 @@ test: variables: - name: ob_sql_work_area_percentage value: 80 - - name: optimizer_use_sql_plan_baselines - value: true - - name: optimizer_capture_sql_plan_baselines - value: true - name: ob_query_timeout value: 36000000000 - name: ob_trx_timeout diff --git a/plugins/grafana/7.5.17/init.py b/plugins/grafana/7.5.17/init.py index 55e744c..40ea1f2 100644 --- a/plugins/grafana/7.5.17/init.py +++ b/plugins/grafana/7.5.17/init.py @@ -115,8 +115,9 @@ def init(plugin_context, local_home_path, repository_dir, *args, **kwargs): dashboard_template_path = os.path.join(home_path, 'conf/provisioning/dashboards/templates') if client.execute_command('bash -c "mkdir -p %s"' % dashboard_template_path): - ob_dashboard = os.path.join(os.path.split(__file__)[0], 'oceanbase-metrics_rev1.json') - client.put_file(ob_dashboard, dashboard_template_path) + file_name = 'oceanbase-metrics_rev1.json' + ob_dashboard = os.path.join(os.path.split(__file__)[0], file_name) + client.put_file(ob_dashboard, os.path.join(dashboard_template_path, file_name)) else: critical(EC_FAIL_TO_INIT_PATH.format(server=server, key='conf/provisioning/dashboards/templates', msg=InitDirFailedErrorMessage.CREATE_FAILED.format(path=dashboard_template_path))) continue diff --git a/plugins/oceanbase/3.1.0/start_check.py b/plugins/oceanbase/3.1.0/start_check.py index 93d35f2..fe757f8 100644 --- a/plugins/oceanbase/3.1.0/start_check.py +++ b/plugins/oceanbase/3.1.0/start_check.py @@ -50,7 +50,6 @@ def parse_size(size): if not isinstance(size, str) or size.isdigit(): _bytes = int(size) else: - print (size) units = {"B": 1, "K": 1<<10, "M": 1<<20, "G": 1<<30, "T": 1<<40} match = re.match(r'(0|[1-9][0-9]*)\s*([B,K,M,G,T])', size.upper()) _bytes = int(match.group(1)) * units[match.group(2)] @@ -264,9 +263,9 @@ def _start_check(plugin_context, strict_check=False, *args, **kwargs): if min_start_need > server_memory_stats['available']: error(EC_OBSERVER_NOT_ENOUGH_MEMORY_ALAILABLE.format(ip=ip, available=format_size(server_memory_stats['available']), need=format_size(min_start_need))) elif total_use > server_memory_stats['free'] + server_memory_stats['buffers'] + server_memory_stats['cached']: - error(EC_OBSERVER_NOT_ENOUGH_MEMORY_CACHED.format(ip=ip, free=format_size(server_memory_stats['free']), cached=format_size(server_memory_stats['buffers'] + server_memory_stats['cached']), need=format_size(min_start_need))) + error(EC_OBSERVER_NOT_ENOUGH_MEMORY_CACHED.format(ip=ip, free=format_size(server_memory_stats['free']), cached=format_size(server_memory_stats['buffers'] + server_memory_stats['cached']), need=format_size(total_use))) elif total_use > server_memory_stats['free']: - alert(EC_OBSERVER_NOT_ENOUGH_MEMORY.format(ip=ip, free=format_size(server_memory_stats['free']), need=format_size(min_start_need))) + alert(EC_OBSERVER_NOT_ENOUGH_MEMORY.format(ip=ip, free=format_size(server_memory_stats['free']), need=format_size(total_use))) # disk disk = {'/': 0} ret = client.execute_command('df --block-size=1024') diff --git a/plugins/oceanbase/3.1.0/upgrade_route.py b/plugins/oceanbase/3.1.0/upgrade_route.py index 9147d69..be428f6 100644 --- a/plugins/oceanbase/3.1.0/upgrade_route.py +++ b/plugins/oceanbase/3.1.0/upgrade_route.py @@ -173,6 +173,10 @@ def upgrade_route(plugin_context, current_repository, dest_repository, *args, ** stdio = plugin_context.stdio repository_dir = dest_repository.repository_dir + if dest_repository.version >= Version("4.1"): + stdio.error('upgrade observer to version {} is not support, please upgrade obd first.'.format(dest_repository.version)) + return + if current_repository.version == dest_repository.version: return plugin_context.return_true(route=format_route([current_repository, dest_repository])) diff --git a/plugins/oceanbase/4.0.0.0/parameter.yaml b/plugins/oceanbase/4.0.0.0/parameter.yaml index 253e223..b456431 100644 --- a/plugins/oceanbase/4.0.0.0/parameter.yaml +++ b/plugins/oceanbase/4.0.0.0/parameter.yaml @@ -1013,7 +1013,7 @@ require: true type: INT default: 2147483648 - min_value: 268435456 + min_value: 1073741824 max_value: NULL need_restart: false description_en: the minimum memory limit of the resource pool diff --git a/plugins/oceanbase/4.0.0.0/start_check.py b/plugins/oceanbase/4.0.0.0/start_check.py index dd08d81..98b9758 100644 --- a/plugins/oceanbase/4.0.0.0/start_check.py +++ b/plugins/oceanbase/4.0.0.0/start_check.py @@ -287,9 +287,9 @@ def _start_check(plugin_context, strict_check=False, *args, **kwargs): if min_start_need > server_memory_stats['available']: error(EC_OBSERVER_NOT_ENOUGH_MEMORY_ALAILABLE.format(ip=ip, available=format_size(server_memory_stats['available']), need=format_size(min_start_need))) elif total_use > server_memory_stats['free'] + server_memory_stats['buffers'] + server_memory_stats['cached']: - error(EC_OBSERVER_NOT_ENOUGH_MEMORY_CACHED.format(ip=ip, free=format_size(server_memory_stats['free']), cached=format_size(server_memory_stats['buffers'] + server_memory_stats['cached']), need=format_size(min_start_need))) + error(EC_OBSERVER_NOT_ENOUGH_MEMORY_CACHED.format(ip=ip, free=format_size(server_memory_stats['free']), cached=format_size(server_memory_stats['buffers'] + server_memory_stats['cached']), need=format_size(total_use))) elif total_use > server_memory_stats['free']: - alert(EC_OBSERVER_NOT_ENOUGH_MEMORY.format(ip=ip, free=format_size(server_memory_stats['free']), need=format_size(min_start_need))) + alert(EC_OBSERVER_NOT_ENOUGH_MEMORY.format(ip=ip, free=format_size(server_memory_stats['free']), need=format_size(total_use))) # disk disk = {'/': 0} ret = client.execute_command('df --block-size=1024') diff --git a/profile/obd.sh b/profile/obd.sh index ee066d9..1aa5028 100644 --- a/profile/obd.sh +++ b/profile/obd.sh @@ -52,7 +52,7 @@ function _obd_complete_func cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" - all_cmds["obd"]="mirror cluster test update repo" + all_cmds["obd"]="mirror cluster test update repo demo" all_cmds["obd cluster"]="autodeploy tenant start deploy redeploy restart reload destroy stop edit-config list display upgrade chst check4ocp reinstall" all_cmds["obd cluster *"]="_obd_reply_deploy_names" all_cmds["obd cluster tenant"]="create drop" @@ -66,8 +66,9 @@ function _obd_complete_func if [ -f "$env_file" ] && [ "$(grep '"OBD_DEV_MODE": "1"' "$env_file")" != "" ]; then all_cmds["obd"]="${all_cmds[obd]} devmode env tool" all_cmds["obd devmode"]="enable disable" - all_cmds["obd tool"]="command db_connect" + all_cmds["obd tool"]="command db_connect dooba" all_cmds["obd tool db_connect"]="_obd_reply_deploy_names" + all_cmds["obd tool dooba"]="_obd_reply_deploy_names" all_cmds["obd tool command"]="_obd_reply_deploy_names" all_cmds["obd tool command *"]="_obd_reply_tool_commands" all_cmds["obd env"]="set unset show clear" -- GitLab