Scenarios
You can use the obdiag rca run command to analyze the disconnection scenario based on the obproxy_diagnosis.log file of OceanBase Database Proxy (ODP).
ODP V4.2.2.0 and later are supported for this feature. When you use obdiag commands, you must configure cluster information in the config.yml file stored in the ~/.obdiag directory or by specifying --config options in the commands. The cluster information contains ODP information.
Supported environment variables
| Variable | Required? | Data type | Default value | Description |
|---|---|---|---|---|
| since | No | string | 30m | The time range of tracing. The default value 30m indicates to trace the exceptions of the last 30 minutes. |
| max_parses_number | No | string | 10 | The maximum number of exceptions that can be analyzed. |
Examples
Specify the scenario in the command. By default, obdiag analyzes the disconnections of the last 30 minutes and supports the analysis of a maximum of 10 exceptions.
obdiag rca run --scene=disconnectionSpecify to analyze the disconnections of the last day. By default, obdiag supports the analysis of a maximum of 10 exceptions.
obdiag rca run --scene=disconnection --input_parameters='{"since":" 1d"}'Specify to analyze the disconnections of the last day and support the analysis of a maximum of 100 exceptions.
obdiag rca run --scene=disconnection --input_parameters='{"since":" 1d","max_parses_number":" 100"}'
Results
The event type in the following command output is CLIENT_VC_TRACE, indicating that the disconnection is initiated by the client. You can perform diagnostics based on relevant logs of the client.
+-----------------------------------------------------------------------------------------------------------+
| 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