【 使用环境 】测试环境
【 OB or 其他组件 】
【 使用版本 】observer-ce 3.1.5
【问题描述】我们不想事务调度由只读语句控制,在测试环境测试参数的时候发现按照文档中的设置不生效
【复现路径】
复现方式:
leader分布情况如下:
ob_proxy_readonly_transaction_routing_policy参数配置情况如下
–执行如下sql
obclient -uroot@ob_mysql -p -P 2883 -h 192.168.0.221
begin;
select * from tab1 where x=2;
select * from tab2 where x=2;
update tab2 set x=22 where x=2;
commit;
如果sql_audit查看plan_type发现 对tab2的路由没办法路由到正确的节点,我的期望是会对tab2的sql会产生play_type=1的执行计划
请问这个是怎么回事呢?
*************************** 8. row ***************************
svr_ip: 192.168.0.221
query_sql: select * from tab1 where x=2
sql_id: A06D31D4838BC119DE2D27F1525B341F
plan_id: 14
trace_id: YB42C0A800DD-000640B0CAFC1CD8
rpc_count: 0
plan_type: 1
is_hit_plan: 1
elapsed_time: 120
execute_time: 60
usec_to_time(request_time): 2025-10-09 12:34:51.529423
8 rows in set (0.020 sec)
*************************** 8. row ***************************
svr_ip: 192.168.0.221
query_sql: select * from tab2 where x=2
sql_id: 3EFF8C6FF3BBD2C606318A3839237810
plan_id: 15
trace_id: YB42C0A800DD-000640B0CAFC1CD9
rpc_count: 2
plan_type: 2
is_hit_plan: 1
elapsed_time: 1697
execute_time: 1597
usec_to_time(request_time): 2025-10-09 12:34:51.564770
8 rows in set (0.019 sec)
*************************** 8. row ***************************
svr_ip: 192.168.0.221
query_sql: update tab2 set x=33 where x=3
sql_id: 1AD8A20A4DF1CD6A2E5FB859AFD09BF3
plan_id: 16
trace_id: YB42C0A800DD-000640B0CAFC1CDA
rpc_count: 2
plan_type: 2
is_hit_plan: 1
elapsed_time: 2177
execute_time: 2024
usec_to_time(request_time): 2025-10-09 12:34:51.567018
2 rows in set (0.019 sec)