Skip to content

Commit

Permalink
fix: major_hold_scene dmesg get
Browse files Browse the repository at this point in the history
 add: version check task
  • Loading branch information
wayyoungboy committed Jan 3, 2025
1 parent 5d027dd commit 6798a35
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
9 changes: 9 additions & 0 deletions plugins/check/tasks/obproxy/version/old_version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
info: 'Check obproxy version . Some versions of obproxy are not recommended'
task:
- steps:
- type: ssh
ssh: "export LD_LIBRARY_PATH=#{remote_home_path}/lib && #{remote_home_path}/bin/obproxy --version 2>&1 | grep \"obproxy (\" | awk '{print $3}'"
result:
set_value: obproxy_version
verify: '[[ ! "${obproxy_version}" == "4.0"* ]] && [[ ! "${obproxy_version}" == "4.1"* ]] && [[ ! "${obproxy_version}" == "4.2"* ]] && [[ ! "${obproxy_version}" == "4.3.0"* ]] && [[ ! "${obproxy_version}" == "3"* ]] && [[ ! "${obproxy_version}" == "4.3.1"* ]]'
err_msg: '#{obproxy_version} is not recommended, please upgrade to the bproxy'
14 changes: 14 additions & 0 deletions plugins/check/tasks/observer/version/old_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@ task:
set_value: observer_version
verify: '[[ ! "#{observer_version}" == *"3.1."* ]] || [[ ! "#{observer_version}" == *"CE"* ]]'
err_msg: 'Starting from June 30, 2024, OceanBase Database Community Edition V3.1.x will no longer receive any bug fixes or version updates.Please upgrade as soon as possible'
- type: ssh
ssh: "echo \"#{observer_version}\" | grep -oP '(?<=\()[^ ]+ \K[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+'"
result:
set_value: observer_version
verify: '[[ ! "${observer_version}" == "4.0"* ]] && [[ ! "${observer_version}" == "4.1"* ]] && [[ ! "${observer_version}" == "4.2.2"* ]] && [[ ! "${observer_version}" == "4.3.0"* ]] && [[ ! "${observer_version}" == "4.3.1"* ]]'
err_msg: '#{observer_version} is not recommended, please upgrade to the obcluster'
- type: ssh
ssh: "echo \"#{observer_version}\" | awk -F. '{print $NF}'"
result:
set_value: observer_version_end_str
verify: '[[ "$observer_version" == "4.2.1"* && "$observer_version_end_str" -ge 5 ]] || [[ ! "$observer_version" == "4.2.1"* ]]'
err_msg: '#{observer_version} is not recommended, please upgrade to the obcluster'





Expand Down
8 changes: 4 additions & 4 deletions plugins/rca/major_hold.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def execute(self):
CDB_OB_MAJOR_COMPACTION_err_tenant_ids.append(str(data.get('TENANT_ID')))
self.record.add_record("CDB_OB_MAJOR_COMPACTION have IS_ERROR='YES',the tenant_ids are {0}".format(err_tenant_ids))
err_tenant_ids.extend(CDB_OB_MAJOR_COMPACTION_err_tenant_ids)

self.record.add_record("check on CDB_OB_MAJOR_COMPACTION IS_ERROR is 'YES'.\n sql:{0}".format(sql), result=err_tenant_ids)
except Exception as e:
self.stdio.warn("MajorHoldScene execute CDB_OB_MAJOR_COMPACTION panic: {0}".format(e))
raise RCAExecuteException("MajorHoldScene execute CDB_OB_MAJOR_COMPACTION panic: {0}".format(e))
Expand Down Expand Up @@ -206,9 +206,9 @@ def execute(self):
# all node execute
for observer_node in self.observer_nodes:
ssh_client = observer_node["ssher"]
ssh_client.exec_cmd("dmesg -T > /tmp/dmesg_{0}.log".format(observer_node.get_name()))
ssh_client.download("/tmp/dmesg_{0}.log".format(observer_node.get_name()), self.local_path + "/dmesg_log")
tenant_record.add_record("download /tmp/dmesg_{0}.log to {1}".format(observer_node.get_name(), self.local_path + "/dmesg_log"))
ssh_client.exec_cmd("dmesg -T > /tmp/dmesg_{0}.log".format(ssh_client.get_name()))
ssh_client.download("/tmp/dmesg_{0}.log".format(ssh_client.get_name()), self.local_path + "/dmesg_log")
tenant_record.add_record("download /tmp/dmesg_{0}.log to {1}".format(ssh_client.get_name(), self.local_path + "/dmesg_log"))
except Exception as e:
self.stdio.warn("MajorHoldScene execute 6 get dmesg exception: {0}".format(e))
tenant_record.add_suggest("send the {0} to the oceanbase community".format(self.local_path))
Expand Down

0 comments on commit 6798a35

Please sign in to comment.