在一个zone的ob中,登陆非系统租户,查询DBA_OB_LS_LOCATIONS超时

【 使用环境 】测试环境
【 OB or 其他组件 】
oceanbase
【 使用版本 】4.1 ce
【问题描述】
1.集群架构:1个zone ,3个server节点
zone1 10.250.37.4
zone1 10.250.37.189
zone1 10.250.37.166
obproxy 10.250.37.156

2.创建test1租户略
3.登陆test1租户,查询视图DBA_OB_LS_LOCATIONS
[root@ob-proxy ~]# mysql -h10.250.37.156 -P2883 -uroot@test1 -pRoot@123 -A oceanbase
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 2097272
Server version: 5.6.25 OceanBase_CE 4.1.0.0 (r100000202023040520-0765e69043c31bf86e83b5d618db0530cf31b707) (Built Apr 5 2023 20:26:14)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MySQL [oceanbase]> select * from DBA_OB_LS_LOCATIONS;
ERROR 4012 (HY000): Timeout, query has reached the maximum query timeout: 10000000(us), maybe you can adjust the session variable ob_query_timeout or query_timeout hint, and try again.
MySQL [oceanbase]>

【复现路径】问题出现前后相关操作
【问题现象及影响】

【附件】

超时时间ob_query_timeout设置长一点。
全局,session,hint都可以

应该不是时间的问题,设置了还是一样超时

如果登陆sys租户此查询就很快

查其他SQL慢不慢

这个视图是两个子查询用union all 组成的,单个执行都很快,放在一起union all 就超时,不管设置ob_query_timeout多少,其它查询没发现慢的。
MySQL [oceanbase]> set global ob_query_timeout=1200000000;
Query OK, 0 rows affected (0.19 sec)

MySQL [oceanbase]> select * from DBA_OB_LS_LOCATIONS;
ERROR 4012 (HY000): Timeout, query has reached the maximum query timeout: 1000000000(us), maybe you can adjust the session variable ob_query_timeout or query_timeout hint, and try again.

[root@ob-proxy ~]# mysql -h10.250.37.156 -P2883 -uroot@test1 -pRoot@123 -A oceanbase
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 2098274
Server version: 5.6.25 OceanBase_CE 4.1.0.0 (r100000202023040520-0765e69043c31bf86e83b5d618db0530cf31b707) (Built Apr 5 2023 20:26:14)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MySQL [oceanbase]>
MySQL [oceanbase]>
MySQL [oceanbase]>
MySQL [oceanbase]> SELECT
→ NOW(6) AS CREATE_TIME,
→ NOW(6) AS MODIFY_TIME,
→ LS_ID,
→ SVR_IP,
→ SVR_PORT,
→ SQL_PORT,
→ ZONE,
→ (CASE
→ ROLE
→ WHEN 1 THEN “LEADER”
→ ELSE “FOLLOWER”
→ END) AS ROLE,
→ (CASE
→ ROLE
→ WHEN 1 THEN MEMBER_LIST
→ ELSE NULL
→ END) AS MEMBER_LIST,
→ (CASE
→ ROLE
→ WHEN 1 THEN PAXOS_REPLICA_NUMBER
→ ELSE NULL
→ END) AS PAXOS_REPLICA_NUMBER,
→ (CASE
→ REPLICA_TYPE WHEN 0 THEN “FULL”
→ WHEN 5 THEN “LOGONLY”
→ WHEN 16 THEN “READONLY”
→ WHEN 261 THEN “ENCRYPTION LOGONLY”
→ ELSE NULL
→ END) AS REPLICA_TYPE
→ FROM
→ OCEANBASE.__ALL_VIRTUAL_CORE_META_TABLE
→ WHERE
→ TENANT_ID = EFFECTIVE_TENANT_ID();
Empty set, 1 warning (0.01 sec)

MySQL [oceanbase]> SELECT
→ GMT_CREATE AS CREATE_TIME,
→ GMT_MODIFIED AS MODIFY_TIME,
→ LS_ID,
→ SVR_IP,
→ SVR_PORT,
→ SQL_PORT,
→ ZONE,
→ (CASE
→ ROLE
→ WHEN 1 THEN “LEADER”
→ ELSE “FOLLOWER”
→ END) AS ROLE,
→ (CASE
→ ROLE
→ WHEN 1 THEN MEMBER_LIST
→ ELSE NULL
→ END) AS MEMBER_LIST,
→ (CASE
→ ROLE
→ WHEN 1 THEN PAXOS_REPLICA_NUMBER
→ ELSE NULL
→ END) AS PAXOS_REPLICA_NUMBER,
→ (CASE
→ REPLICA_TYPE WHEN 0 THEN “FULL”
→ WHEN 5 THEN “LOGONLY”
→ WHEN 16 THEN “READONLY”
→ WHEN 261 THEN “ENCRYPTION LOGONLY”
→ ELSE NULL
→ END) AS REPLICA_TYPE
→ FROM
→ OCEANBASE.__ALL_VIRTUAL_LS_META_TABLE
→ WHERE
→ TENANT_ID = EFFECTIVE_TENANT_ID()
→ AND TENANT_ID != 1 ;
±---------------------------±---------------------------±------±--------------±---------±---------±------±-------±---------------------±---------------------±-------------+
| CREATE_TIME | MODIFY_TIME | LS_ID | SVR_IP | SVR_PORT | SQL_PORT | ZONE | ROLE | MEMBER_LIST | PAXOS_REPLICA_NUMBER | REPLICA_TYPE |
±---------------------------±---------------------------±------±--------------±---------±---------±------±-------±---------------------±---------------------±-------------+
| 2023-05-10 17:55:21.680328 | 2023-05-10 17:55:24.726233 | 1 | 10.250.37.166 | 2882 | 2881 | zone1 | LEADER | 10.250.37.166:2882:1 | 1 | FULL |
| 2023-05-10 17:55:32.148298 | 2023-05-10 17:55:34.196359 | 1001 | 10.250.37.166 | 2882 | 2881 | zone1 | LEADER | 10.250.37.166:2882:1 | 1 | FULL |
±---------------------------±---------------------------±------±--------------±---------±---------±------±-------±---------------------±---------------------±-------------+
2 rows in set (0.02 sec)

收到,我们测试下看看能不能复现

用户租户下查询会报错OB_TENANT_NOT_IN_SERVER ,一直重试到超时。导致客户端报错查询超时。 ,新版本修复了这个问题。
https://github.com/oceanbase/oceanbase/commit/ba4460ca3f33f036bf590f9a1b2a67366ff87adc