-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #227 from wayyoungboy/2.2.0-qulei
2.2.0 add rca scene and uodate check
- Loading branch information
Showing
22 changed files
with
1,555 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: UTF-8 -* | ||
# Copyright (c) 2022 OceanBase | ||
# OceanBase Diagnostic Tool is licensed under Mulan PSL v2. | ||
# You can use this software according to the terms and conditions of the Mulan PSL v2. | ||
# You may obtain a copy of Mulan PSL v2 at: | ||
# http://license.coscl.org.cn/MulanPSL2 | ||
# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | ||
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | ||
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | ||
# See the Mulan PSL v2 for more details. | ||
|
||
""" | ||
@time: 2024/05/28 | ||
@file: sleep.py | ||
@desc: | ||
""" | ||
import time | ||
|
||
from handler.checker.check_exception import StepExecuteFailException | ||
from common.ob_connector import OBConnector | ||
from common.tool import StringUtils | ||
from common.tool import Util | ||
|
||
|
||
class StepSleepHandler: | ||
def __init__(self, context, step, task_variable_dict): | ||
self.sleep_time = None | ||
try: | ||
self.context = context | ||
self.stdio = context.stdio | ||
self.ob_cluster = self.context.cluster_config | ||
self.ob_cluster_name = self.ob_cluster.get("cluster_name") | ||
self.tenant_mode = None | ||
self.sys_database = None | ||
self.database = None | ||
self.ob_connector_pool = self.context.get_variable('check_obConnector_pool', None) | ||
if self.ob_connector_pool is not None: | ||
self.ob_connector = self.ob_connector_pool.get_connection() | ||
if self.ob_connector is None: | ||
raise Exception("self.ob_connector is None.") | ||
except Exception as e: | ||
self.stdio.error("StepSleepHandler init fail. Please check the OBCLUSTER conf. Exception : {0} .".format(e)) | ||
raise Exception("StepSleepHandler init fail. Please check the OBCLUSTER conf. Exception : {0} .".format(e)) | ||
self.task_variable_dict = task_variable_dict | ||
self.enable_dump_db = False | ||
self.trace_id = None | ||
self.STAT_NAME = {} | ||
self.report_file_path = "" | ||
self.enable_fast_dump = False | ||
self.ob_major_version = None | ||
self.step = step | ||
|
||
def execute(self): | ||
try: | ||
self.sleep_time = self.step.get("sleep", None) | ||
if self.sleep_time == None: | ||
raise StepExecuteFailException("StepSleepHandler execute sleep is not set") | ||
if type(self.sleep_time) != int: | ||
raise StepExecuteFailException("StepSleepHandler execute sleep type must be int") | ||
time.sleep(int(self.sleep_time)) | ||
self.stdio.verbose("StepSleepHandler execute: {0}".format(self.sleep_time)) | ||
except Exception as e: | ||
self.stdio.error("StepSleepHandler execute Exception: {0}".format(e)) | ||
raise StepExecuteFailException("StepSleepHandler execute Exception: {0}".format(e)) | ||
finally: | ||
self.ob_connector_pool.release_connection(self.ob_connector) | ||
|
||
def update_step_variable_dict(self): | ||
return self.task_variable_dict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
info: "Check if there is a problem with clog disk full" | ||
task: | ||
- version: "[4.0.0.0,*]" | ||
steps: | ||
- type: sql | ||
sql: 'SELECT GROUP_CONCAT(DISTINCT u.tenant_id) FROM oceanbase.gv$ob_units u JOIN ( SELECT SVR_IP, SVR_PORT, TENANT_ID, value/100 AS value FROM oceanbase.GV$OB_PARAMETERS WHERE name = "log_disk_utilization_threshold") as c ON u.SVR_IP = c.SVR_IP AND u.SVR_PORT = c.SVR_PORT AND u.TENANT_ID = c.TENANT_ID WHERE u.LOG_DISK_IN_USE > u.LOG_DISK_SIZE * c.value;' | ||
result: | ||
set_value: tenant_ids | ||
verify: '[ -z "$tenant_ids" ]' | ||
err_msg: "The following tenants have experienced clog disk full: #{tenant_ids}. Please check by obdiag rca --scene=clog_disk_full " |
11 changes: 11 additions & 0 deletions
11
handler/checker/tasks/observer/column_storage/tenant_parameters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
info: 'Check whether there is any observer have CPU oversold.' | ||
task: | ||
- version: "[4.3.1.0,*]" | ||
steps: | ||
- type: sql | ||
sql: "SELECT GROUP_CONCAT(CONCAT(SVR_IP, ':', SVR_PORT) SEPARATOR ', ') AS IP_PORT_COMBINATIONSFROM from oceanbase.GV$OB_SERVERS WHERE CPU_ASSIGNED > CPU_CAPACITY;" | ||
result: | ||
set_value: CPU_oversold | ||
verify: '[ -z "$CPU_oversold" ]' | ||
report_type: warning | ||
err_msg: 'Some observers have CPU oversold. There are #{CPU_oversold}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.