Applicable scenarios
This article applies to the scenario of broken links, based on ODP's diagnostic log obproxy_diagnosis.log, and locates the problem by analyzing the log.
Currently supports ODP V4.2.2.0 and later versions. When using obdiag, you need to configure the cluster information (including ODP information) in the ~/.obdiag/config.yml file according to your choice, or configure the cluster information (including ODP information) through the --config option in the command.
Can import environment variables
Variable name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| since | No | string | 30m | Specify the time to trace back, the default is 30 minutes |
| max_parses_number | No | string | 10 | Maximum number of analyzed abnormal scenarios |
Usage example
- Executed by default, analyzing link disconnection scenarios within 30 minutes, and up to 10 abnormal scenarios.
obdiag rca run --scene=disconnection
```* Designate to analyze link disconnection scenarios within a day, and analyze up to 10 abnormal scenarios.
```shell
obdiag rca run --scene=disconnection --env since=1d
```* Specify the analysis of link disconnection scenarios within a day, and set up to analyze up to 100 abnormal scenarios.
```shell
obdiag rca run --scene=disconnection --env since=1d --env max_parses_number=100
Analysis result example
The following is the link disconnection troubleshooting result after executing the command. The output event type is CLIENT_VC_TRACE. It can be determined that the connection was actively disconnected by the client, and the client's cooperation is required for diagnosis.
+-----------------------------------------------------------------------------------------------------------+
| record |
+------+----------------------------------------------------------------------------------------------------+
| step | info |
+------+----------------------------------------------------------------------------------------------------+
| 1 | node:xxx.xxx.xxx obproxy_diagnosis_log:[2024-01-18 17:48:37.667014] [23173][Y0-00007FAA5183E710] |
| | [CONNECTION](trace_type="CLIENT_VC_TRACE", connection_diagnosis={cs_id:1065, ss_id:4559, |
| | proxy_session_id:837192278409543969, server_session_id:3221810838, |
| | client_addr:"xxx.xxx.xxx.xxx:xxxx", server_addr:"xxx.xxx.xxx.xxx:2883", cluster_name:"obcluster", |
| | tenant_name:"sys", user_name:"root", error_code:-10010, error_msg:"An unexpected connection event |
| | received from client while obproxy reading request", request_cmd:"COM_SLEEP", sql_cmd:"COM_END", |
| | req_total_time(us):5315316}{vc_event:"VC_EVENT_EOS", user_sql:""}) |
| 2 | cs_id:1065, server_session_id:3221810838 |
| 3 | trace_type:CLIENT_VC_TRACE |
| 4 | error_code:-10010 |
+------+----------------------------------------------------------------------------------------------------+
The suggest: Need client cooperation for diagnosis
