Skip to content

Commit

Permalink
Merge pull request #198 from frf12/V2.9.1
Browse files Browse the repository at this point in the history
V2.9.1
  • Loading branch information
gys-git authored Jun 13, 2024
2 parents d45db5b + 7236aae commit fcefb29
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion plugins/oceanbase/4.0.0.0/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion plugins/oceanbase/4.2.1.0/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion plugins/oceanbase/4.2.1.4/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 0 additions & 3 deletions plugins/oceanbase/4.2.1.4/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion plugins/oceanbase/4.2.1.4/restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions plugins/oceanbase/4.2.1.4/start_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 0 additions & 3 deletions plugins/oceanbase/4.2.2.0/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion plugins/oceanbase/4.2.2.0/restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions plugins/oceanbase/4.2.2.0/start_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 0 additions & 3 deletions plugins/oceanbase/4.3.0.0/start_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 0 additions & 1 deletion plugins/oceanbase/4.3.0.0/tenant_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions service/service-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit fcefb29

Please sign in to comment.