Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 2.3.0_bug_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Teingi committed Jul 17, 2024
2 parents 57a6dd3 + 71283b6 commit d157234
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/ssh_client/local_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def upload(self, remote_path, local_path):
try:
shutil.copy(local_path, remote_path)
except Exception as e:
self.stdio.error("upload file to localhost, remote _path =[{0}], local _path=[{1}], error=[{2}]".format(remote_path, local_path, str(e)))
self.stdio.error("upload file to localhost, remote_path =[{0}], local_path=[{1}], error=[{2}]".format(remote_path, local_path, str(e)))
raise Exception("[local] upload file to localhost, remote _path =[{0}], local _path=[{1}], error=[{2}]".format(remote_path, local_path, str(e)))

def ssh_invoke_shell_switch_user(self, new_user, cmd, time_out):
Expand Down
2 changes: 1 addition & 1 deletion common/ssh_client/remote_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def progress_bar(self, transferred, to_be_transferred, suffix=''):
def upload(self, remote_path, local_path):
transport = self._ssh_fd.get_transport()
self._sftp_client = paramiko.SFTPClient.from_transport(transport)
self._sftp_client.put(remote_path, local_path)
self._sftp_client.put(local_path, remote_path)
self._sftp_client.close()

def ssh_invoke_shell_switch_user(self, new_user, cmd, time_out):
Expand Down
2 changes: 1 addition & 1 deletion handler/gather/gather_obproxy_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def __pharse_log(self, ssh_client, home_path, log_name, gather_path):
grep_cmd = "grep -e '{0}' ".format(grep_arg) + "{log_dir}/{log_name}".format(log_name=log_name, log_dir=log_path)
continue
grep_cmd += "| grep -e '{0}'".format(grep_arg)
grep_cmd += " >> {log_dir}/{log_name}".format(log_name=log_name, log_dir=log_path)
grep_cmd += " >> {gather_path}/{log_name}".format(log_name=log_name, gather_path=gather_path)
self.stdio.verbose("grep files, run cmd = [{0}]".format(grep_cmd))
ssh_client.exec_cmd(grep_cmd)
else:
Expand Down
12 changes: 12 additions & 0 deletions handler/rca/scene/index_ddl_error_scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ def execute(self):
self.verbose("gather rootservice.log by {0}".format(self.trace_id))
work_path_rs = self.store_dir + "/{0}_on_rs/".format(self.trace_id)
self.gather_log.set_parameters("scope", "rootservice")
if self.input_parameters.get("since") is not None:
since = self.input_parameters.get("since")
self.gather_log.set_parameters("since", since)
self.gather_log.grep("{0}".format(self.trace_id))
logs_name = self.gather_log.execute(save_path=work_path_rs)
if logs_name is None or len(logs_name) <= 0:
Expand All @@ -161,6 +164,9 @@ def execute(self):
self.verbose("gather observer.log by {0}".format(self.trace_id))
work_path_ddl_wait_trans_end_ctx_try_wait = self.store_dir + "/{0}_on_obs/".format(self.trace_id)
self.gather_log.set_parameters("scope", "observer")
if self.input_parameters.get("since") is not None:
since = self.input_parameters.get("since")
self.gather_log.set_parameters("since", since)
self.gather_log.grep("{0}".format(self.trace_id))
logs_name = self.gather_log.execute(save_path=work_path_ddl_wait_trans_end_ctx_try_wait)
if logs_name is None or len(logs_name) <= 0:
Expand All @@ -176,6 +182,9 @@ def execute(self):
# index_sstable_build_task_finish
work_path_index_sstable_build_task_finish = self.store_dir + "/{0}_on_obs/".format(self.trace_id)
self.gather_log.set_parameters("scope", "observer")
if self.input_parameters.get("since") is not None:
since = self.input_parameters.get("since")
self.gather_log.set_parameters("since", since)
self.gather_log.grep("{0}".format(self.trace_id))
logs_name = self.gather_log.execute(save_path=work_path_index_sstable_build_task_finish)
if logs_name is None or len(logs_name) <= 0:
Expand All @@ -191,6 +200,9 @@ def execute(self):
self.verbose("gather rootservice.log by {0}".format(self.trace_id))
work_path_rs = self.store_dir + "/{0}_on_rs/".format(self.trace_id)
self.gather_log.set_parameters("scope", "rootservice")
if self.input_parameters.get("since") is not None:
since = self.input_parameters.get("since")
self.gather_log.set_parameters("since", since)
self.gather_log.grep("{0}".format(self.trace_id))
logs_name = self.gather_log.execute(save_path=work_path_rs)
if logs_name is None or len(logs_name) <= 0:
Expand Down

0 comments on commit d157234

Please sign in to comment.