适用版本:V2.1.x、V2.2.x、V3.1.x、V3.2.x
5065 与 5066 是两个近似的报错。
-
OB_ERR_QUERY_INTERRUPTED(-5065):
-
Message: Query execution was interrupted。
-
含义为执行中断, 例如终端执行 SQL 过程中按 ctrl+c 终止 SQL 执行会报 -5065。
-
-
OB_ERR_SESSION_INTERRUPTED(-5066):
-
Message: Session interrupted。
-
含义为 session 中断, 例如 SQL 执行过程中连接池超时断开网络链接,或者终端执行过程中 kill 掉 OBServer 进程断开网络链接。
-
问题复现模拟上述报错的示例:
-
发起某个业务查询语句,数秒后,并通过 Ctrl + C 取消此语句。
obclient [SYS]> select count(*) records from NGCRM_XX.CM_SUBS_PRODATTR tsa; ^CCtrl-C -- query killed. Continuing normally. ORA-00600: internal error code, arguments: -5065, Query execution was interrupted
-
查询当前会话的 ID ,并再次发起业务查询语句。
-
查询当前会话 ID.
obclient [SYS]> show processlist;
输出结果如下:
+--------+----------+------+---------------------+------+-------------+-------------------+-------------------+---------+---------+ | Id | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid | +--------+----------+------+---------------------+------+-------------+-------------------+-------------------+---------+---------+ | 219088 | oboracle | SYS | 10.xxx.xxx.xx:43752 | SYS | 0 | 1 | MCS_ACTIVE_READER | 2059664 | 2059653 | +--------+----------+------+---------------------+------+-------------+-------------------+-------------------+---------+---------+ 1 row in set (0.006 sec)
-
发起执行业务查询语句。
obclient [SYS]> select count(*) records from NGCRM_XX.CM_SUBS_PRODATTR tsb;
-
-
在另一个窗口,执行终止会话的操作。
[root@xxxx] kill -9 219088
-
返回原窗口,此时可看到第二次发起的业务查询语句也报错了。
ERROR-02013: Lost connection to MySQL server during query
-
登录 SYS 租户,通过 SQL_AUDIT 查询报错信息,可分别看到 5065 以及 5066 的报错。
obclient [oceanbase]> select svr_ip,ret_code,query_sql from gv$sql_audit where query_sql like 'select%count%CM_SUBS_PRODATTR ts%'\G;
输出结果如下:
*************************** 1. row *************************** svr_ip: xxx.xxx.xxx.xxx ret_code: -5065 query_sql: select count(*) records from NGCRM_XX.CM_SUBS_PRODATTR tsa *************************** 2. row *************************** svr_ip: xxx.xxx.xxx.xxx ret_code: -5066 query_sql: select count(*) records from NGCRM_XX.CM_SUBS_PRODATTR tsb 2 rows in set (20.974 sec)