From 7236aae2dbba54fbb20fbde9333943d720b680f1 Mon Sep 17 00:00:00 2001 From: frf12 Date: Thu, 13 Jun 2024 10:35:41 +0800 Subject: [PATCH] V2.9.1 --- plugins/oceanbase/4.0.0.0/bootstrap.py | 2 +- plugins/oceanbase/4.2.1.0/bootstrap.py | 2 +- plugins/oceanbase/4.2.1.4/bootstrap.py | 2 +- plugins/oceanbase/4.2.1.4/init.py | 3 --- plugins/oceanbase/4.2.1.4/restart.py | 1 - plugins/oceanbase/4.2.1.4/start_check.py | 3 --- plugins/oceanbase/4.2.2.0/init.py | 3 --- plugins/oceanbase/4.2.2.0/restart.py | 1 - plugins/oceanbase/4.2.2.0/start_check.py | 3 --- plugins/oceanbase/4.3.0.0/start_check.py | 3 --- plugins/oceanbase/4.3.0.0/tenant_optimize.py | 1 - service/service-requirements.txt | 1 + 12 files changed, 4 insertions(+), 21 deletions(-) diff --git a/plugins/oceanbase/4.0.0.0/bootstrap.py b/plugins/oceanbase/4.0.0.0/bootstrap.py index 48d5da9..ec64581 100644 --- a/plugins/oceanbase/4.0.0.0/bootstrap.py +++ b/plugins/oceanbase/4.0.0.0/bootstrap.py @@ -147,7 +147,7 @@ def is_bootstrap(): continue # set create tenant variable for key in global_conf_with_default: - if key.startswith(prefix) and original_global_conf.get(key, None): + if key.startswith(prefix) and not original_global_conf.get(key, None): if ocp_config and ocp_config.get(key, None): global_conf_with_default[key] = ocp_config[key] global_conf_with_default[prefix + 'tenant'][key.replace(prefix, '', 1)] = global_conf_with_default[key] diff --git a/plugins/oceanbase/4.2.1.0/bootstrap.py b/plugins/oceanbase/4.2.1.0/bootstrap.py index dd065db..732e517 100644 --- a/plugins/oceanbase/4.2.1.0/bootstrap.py +++ b/plugins/oceanbase/4.2.1.0/bootstrap.py @@ -156,7 +156,7 @@ def is_bootstrap(): continue # set create tenant variable for key in global_conf_with_default: - if key.startswith(prefix) and original_global_conf.get(key, None): + if key.startswith(prefix) and not original_global_conf.get(key, None): if ocp_config and ocp_config.get(key, None): global_conf_with_default[key] = ocp_config[key] global_conf_with_default[prefix + 'tenant'][key.replace(prefix, '', 1)] = global_conf_with_default[key] diff --git a/plugins/oceanbase/4.2.1.4/bootstrap.py b/plugins/oceanbase/4.2.1.4/bootstrap.py index c486916..fb1859a 100644 --- a/plugins/oceanbase/4.2.1.4/bootstrap.py +++ b/plugins/oceanbase/4.2.1.4/bootstrap.py @@ -269,7 +269,7 @@ def bootstrap(plugin_context, need_bootstrap=True, *args, **kwargs): continue # set create tenant variable for key in global_conf_with_default: - if key.startswith(prefix) and original_global_conf.get(key, None): + if key.startswith(prefix) and not original_global_conf.get(key, None): if ocp_config and ocp_config.get(key, None): global_conf_with_default[key] = ocp_config[key] global_conf_with_default[prefix + 'tenant'][key.replace(prefix, '', 1)] = global_conf_with_default[key] diff --git a/plugins/oceanbase/4.2.1.4/init.py b/plugins/oceanbase/4.2.1.4/init.py index 168fd80..ea7d200 100644 --- a/plugins/oceanbase/4.2.1.4/init.py +++ b/plugins/oceanbase/4.2.1.4/init.py @@ -70,7 +70,6 @@ def init(plugin_context, *args, **kwargs): clean = getattr(plugin_context.options, 'clean', False) stdio.verbose('option `force` is %s' % force) stdio.start_loading('Initializes observer work home') - tmp_sock_dir = '/tmp/obshell' for server in cluster_config.servers: ip = server.ip if ip not in servers_dirs: @@ -131,8 +130,6 @@ def init(plugin_context, *args, **kwargs): if not client.execute_command('rm -f %s/.meta' % home_path): critical(EC_FAIL_TO_INIT_PATH.format(server=server, key='home path', msg=InitDirFailedErrorMessage.CREATE_FAILED.format(path=home_path))) - if not client.execute_command('mkdir -p {dir}; [ -w {dir} ] || chmod +666 {dir}'.format(dir=tmp_sock_dir)): - critical(EC_FAIL_TO_INIT_PATH.format(server=server, key='sock path', msg=InitDirFailedErrorMessage.CREATE_FAILED.format(path=tmp_sock_dir))) ret = client.execute_command('bash -c "mkdir -p %s/{etc,admin,.conf,log,log_obshell,bin,lib}"' % home_path) if ret: diff --git a/plugins/oceanbase/4.2.1.4/restart.py b/plugins/oceanbase/4.2.1.4/restart.py index 138a7ba..81bd0aa 100644 --- a/plugins/oceanbase/4.2.1.4/restart.py +++ b/plugins/oceanbase/4.2.1.4/restart.py @@ -191,7 +191,6 @@ def _restart(self): for server in self.cluster_config.servers: new_client = self.new_clients[server] server_config = self.cluster_config.get_server_conf(server) - new_client.execute_command('[ -w {dir} ] || chmod +666 {dir}'.format(dir='/tmp/obshell')) chown_cmd = 'sudo chown -R %s:' % new_client.config.username for key in ['home_path', 'data_dir', 'redo_dir', 'clog_dir', 'ilog_dir', 'slog_dir', '.meta', 'log_obshell']: if key in server_config: diff --git a/plugins/oceanbase/4.2.1.4/start_check.py b/plugins/oceanbase/4.2.1.4/start_check.py index 0b1525e..9ede8e7 100644 --- a/plugins/oceanbase/4.2.1.4/start_check.py +++ b/plugins/oceanbase/4.2.1.4/start_check.py @@ -427,9 +427,6 @@ def system_memory_check(): ip_server_memory_info = {} for ip in servers_disk: - if not client.execute_command("[ -w /tmp/ ] || [ -w /tmp/obshell ]"): - critical("dir", err.EC_FAIL_TO_INIT_PATH.format(server=server, key='sock path', msg=err.InitDirFailedErrorMessage.PERMISSION_DENIED.format(path='/tmp/obshell'))) - ip_servers = servers_memory[ip]['servers'].keys() server_num = len(ip_servers) client = servers_clients[ip] diff --git a/plugins/oceanbase/4.2.2.0/init.py b/plugins/oceanbase/4.2.2.0/init.py index 168fd80..ea7d200 100644 --- a/plugins/oceanbase/4.2.2.0/init.py +++ b/plugins/oceanbase/4.2.2.0/init.py @@ -70,7 +70,6 @@ def init(plugin_context, *args, **kwargs): clean = getattr(plugin_context.options, 'clean', False) stdio.verbose('option `force` is %s' % force) stdio.start_loading('Initializes observer work home') - tmp_sock_dir = '/tmp/obshell' for server in cluster_config.servers: ip = server.ip if ip not in servers_dirs: @@ -131,8 +130,6 @@ def init(plugin_context, *args, **kwargs): if not client.execute_command('rm -f %s/.meta' % home_path): critical(EC_FAIL_TO_INIT_PATH.format(server=server, key='home path', msg=InitDirFailedErrorMessage.CREATE_FAILED.format(path=home_path))) - if not client.execute_command('mkdir -p {dir}; [ -w {dir} ] || chmod +666 {dir}'.format(dir=tmp_sock_dir)): - critical(EC_FAIL_TO_INIT_PATH.format(server=server, key='sock path', msg=InitDirFailedErrorMessage.CREATE_FAILED.format(path=tmp_sock_dir))) ret = client.execute_command('bash -c "mkdir -p %s/{etc,admin,.conf,log,log_obshell,bin,lib}"' % home_path) if ret: diff --git a/plugins/oceanbase/4.2.2.0/restart.py b/plugins/oceanbase/4.2.2.0/restart.py index 138a7ba..81bd0aa 100644 --- a/plugins/oceanbase/4.2.2.0/restart.py +++ b/plugins/oceanbase/4.2.2.0/restart.py @@ -191,7 +191,6 @@ def _restart(self): for server in self.cluster_config.servers: new_client = self.new_clients[server] server_config = self.cluster_config.get_server_conf(server) - new_client.execute_command('[ -w {dir} ] || chmod +666 {dir}'.format(dir='/tmp/obshell')) chown_cmd = 'sudo chown -R %s:' % new_client.config.username for key in ['home_path', 'data_dir', 'redo_dir', 'clog_dir', 'ilog_dir', 'slog_dir', '.meta', 'log_obshell']: if key in server_config: diff --git a/plugins/oceanbase/4.2.2.0/start_check.py b/plugins/oceanbase/4.2.2.0/start_check.py index ebf2d0c..3463bca 100644 --- a/plugins/oceanbase/4.2.2.0/start_check.py +++ b/plugins/oceanbase/4.2.2.0/start_check.py @@ -428,9 +428,6 @@ def system_memory_check(): ip_server_memory_info = {} for ip in servers_disk: - if not client.execute_command("[ -w /tmp/ ] || [ -w /tmp/obshell ]"): - critical("dir", err.EC_FAIL_TO_INIT_PATH.format(server=server, key='sock path', msg=err.InitDirFailedErrorMessage.PERMISSION_DENIED.format(path='/tmp/obshell'))) - ip_servers = servers_memory[ip]['servers'].keys() server_num = len(ip_servers) client = servers_clients[ip] diff --git a/plugins/oceanbase/4.3.0.0/start_check.py b/plugins/oceanbase/4.3.0.0/start_check.py index eb34084..bee9f1c 100644 --- a/plugins/oceanbase/4.3.0.0/start_check.py +++ b/plugins/oceanbase/4.3.0.0/start_check.py @@ -439,9 +439,6 @@ def system_memory_check(): ip_server_memory_info = {} for ip in servers_disk: - if not client.execute_command("[ -w /tmp/ ] || [ -w /tmp/obshell ]"): - critical("dir", err.EC_FAIL_TO_INIT_PATH.format(server=server, key='sock path', msg=err.InitDirFailedErrorMessage.PERMISSION_DENIED.format(path='/tmp/obshell'))) - ip_servers = servers_memory[ip]['servers'].keys() server_num = len(ip_servers) client = servers_clients[ip] diff --git a/plugins/oceanbase/4.3.0.0/tenant_optimize.py b/plugins/oceanbase/4.3.0.0/tenant_optimize.py index 6d31c54..ca278b7 100644 --- a/plugins/oceanbase/4.3.0.0/tenant_optimize.py +++ b/plugins/oceanbase/4.3.0.0/tenant_optimize.py @@ -116,7 +116,6 @@ def _optimize(json_files): path = repository.repository_dir break - scenario = getattr(plugin_context.options, 'optimize', '') global_config = cluster_config.get_global_conf_with_default() if scenario: check_result = scenario_check(scenario) diff --git a/service/service-requirements.txt b/service/service-requirements.txt index 13b97c5..35031b2 100644 --- a/service/service-requirements.txt +++ b/service/service-requirements.txt @@ -1,6 +1,7 @@ argparse==1.4.0 pyyaml==6.0 pymongo==4.2.0 +idna==2.10 fastapi==0.87.0 uvicorn==0.20.0 asgi-correlation-id==3.2.1