执行 Sysbench 出现2个错误

使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】社区版4.2
【问题描述】

当使用的 OBClient 版本大于等于 2.2.0 时,会默认开启 ob20 协议以及全链路追踪的能力,在 Sysbench 测试中会影响性能,建议通过设置环境变量手动关闭:export ENABLE_PROTOCOL_OB20=0 。[执行了]

按照下面文档
obd 工具做性能测试时候。
https://www.oceanbase.com/docs/common-oceanbase-database-cn-0000000001953499

问题1 :

OBD-5000: alter system set _trace_control_info=%s tenant=“tpctest” execute failed

在执行obd 一键性能测试时候 ,obd 优化参数报错

在按照上面文档操作过程过程

./ob_sysbench.sh

Get local repositories and plugins ok

Cluster status check ok

Connect to observer ok

Optimize for stage test x

[ERROR] OBD-5000: alter system set _trace_control_info=%s tenant="tpctest" execute failed

[ERROR] Failed to optimize system_config

手工执行:

obclient [oceanbase]> alter system set _trace_control_info=’%s’ tenant=“tpctest”;

ERROR 4179 (HY000): alter the parameter _trace_control_info not allowe

  • 执行其其他类型测试也是如此

问: 如何关闭 这个 特性 _trace_control_info
性能测试场景可以根据需要关闭该功能。

问2: 不用obd 一键执行 ,sql命令和obd客户端都可以登陆。

手工执行;

sysbench oltp_read_write.lua  --mysql-port=2281 --mysql-db=sysbench_test --mysql-user="root@tpctest"  --table_size=10000 --tables=5 --threads=2 --report-interval=10 --rand-type=uniform --time=60 prepare

错误链接不上

ATAL: error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL: `sysbench.cmdline.call_command' function failed: ./oltp_common.lua:83: connection creation failed
FATAL: error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
FATAL: `sysbench.cmdline.call_command' function failed: ./oltp_common.lua:83: connection creation faile

增加 ip 地址:
sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=127.0.0.1 --mysql-port=2281 --mysql-db=sysbench_test --mysql-user="root@tpctest" --table_size=10000 --tables=5 --threads=2 --report-interval=10 --rand-type=uniform --time=60 prepare


FATAL: error 2003: Can't connect to MySQL server on '127.0.0.1' (111)

FATAL: `sysbench.cmdline.call_command' function failed: /usr/share/sysbench/oltp_common.lua:83: connection creation failed

FATAL: error 2003: Can't connect to MySQL server on '127.0.0.1' (111)

FATAL: `sysbench.cmdline.call_command' function failed: /usr/share/sysbench/oltp_common.lua:83: connection creation failed
  • 当使用的 OBClient 版本大于等于 2.2.0 时,会默认开启 ob20 协议以及全链路追踪的能力,在 Sysbench 测试中会影响性能,建议通过设置环境变量手动关闭:export ENABLE_PROTOCOL_OB20=0
    这个设置了
[2023-05-20 10:34:49.236] [DEBUG] }(str) target_value (str) condition lambda n, o: n != o
[2023-05-20 10:34:49.237] [DEBUG] -- execute sql: alter system set _trace_control_info=%s tenant="tpctest". args: ('',)
[2023-05-20 10:34:49.238] [ERROR] OBD-5000: alter system set _trace_control_info=%s tenant="tpctest" execute failed
[2023-05-20 10:34:49.240] [ERROR] Failed to optimize system_config
[2023-05-20 10:34:49.240] [ERROR] Traceback (most recent call last):
[2023-05-20 10:34:49.240] [ERROR]   File "core.py", line 3346, in sysbench
[2023-05-20 10:34:49.240] [ERROR]   File "core.py", line 2876, in _test_optimize_operation
[2023-05-20 10:34:49.240] [ERROR]   File "core.py", line 182, in call_plugin
[2023-05-20 10:34:49.240] [ERROR]   File "_plugin.py", line 314, in __call__
[2023-05-20 10:34:49.240] [ERROR]   File "_plugin.py", line 281, in _new_func
[2023-05-20 10:34:49.240] [ERROR]   File "/root/.obd/plugins/optimize/0.1/optimize.py", line 62, in optimize
[2023-05-20 10:34:49.240] [ERROR]     if entrance.optimize(**opt_kwargs):
[2023-05-20 10:34:49.240] [ERROR]   File "/root/.obd/optimize/optimize_parser/0.1/optimize_parser.py", line 418, in optimize
[2023-05-20 10:34:49.240] [ERROR]     ret = item.optimize(*args, stdio=stdio, **kwargs)
[2023-05-20 10:34:49.240] [ERROR]   File "/root/.obd/optimize/optimize_parser/0.1/optimize_parser.py", line 318, in optimize
[2023-05-20 10:34:49.240] [ERROR]     raise Exception('fail to optimize {} to {}'.format(self.name, self.value))
[2023-05-20 10:34:49.240] [ERROR] Exception: fail to optimize _trace_control_info to 
[2023-05-20 10:34:49.240] [ERROR] 
[2023-05-20 10:34:49.240] [DEBUG] -- optimize <optimize_parser.SystemConfigEntrance object at 0x7f884b7e5a30> failed
[2023-05-20 10:34:49.287] [INFO] [ERROR] OBD-5000: alter system set _trace_control_info=%s tenant="tpctest" execute failed
[2023-05-20 10:34:49.287] [INFO] [ERROR] Failed to optimize system_config
[2023-05-20 10:34:49.288] [INFO] 

/root/.obd/optimize/oceanbase-ce/4.1.0/sysbench.yaml 去掉 _trace_control_info参数。