【产品名称】obproxy
【产品版本】v3.2.0
【问题描述】通过obproxy 连接集群后,执行prepare语句报lose connection
【产品名称】obproxy
【产品版本】v3.2.0
【问题描述】通过obproxy 连接集群后,执行prepare语句报lose connection
麻烦提供下obproxy的日志,以及observer的版本。
另外,默认情况下prepare是关闭的,可以通过如下命令查看和打开
select * from oceanbase.__all_virtual_sys_parameter_stat where name="_ob_enable_prepared_statement";
ALTER system set _ob_enable_prepared_statement =true;
按照提示打开了prepare:
MySQL [oceanbase]> select name, data_type, value, scope from oceanbase.__all_virtual_sys_parameter_stat where name='_ob_enable_prepared_statement';
+-------------------------------+-----------+-------+---------+
| name | data_type | value | scope |
+-------------------------------+-----------+-------+---------+
| _ob_enable_prepared_statement | NULL | True | CLUSTER |
| _ob_enable_prepared_statement | NULL | True | CLUSTER |
| _ob_enable_prepared_statement | NULL | True | CLUSTER |
+-------------------------------+-----------+-------+---------+
observer 已经升级到了最新的社区版本:
MySQL [oceanbase]> select version();
+--------------------+
| version() |
+--------------------+
| 3.1.2-OceanBase CE |
+--------------------+
1 row in set (0.00 sec)
通过proxy执行prepare依旧失败:
MySQL [test]> prepare stmt1 from 'INSERT INTO test.tb1 (id , name ) values ( ? , ? )';
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> prepare stmt1 from 'INSERT INTO test.tb1 (id , name ) values ( ? , ? )';
ERROR 2013 (HY000): Lost connection to MySQL server during query
MySQL [test]> prepare stmt1 from 'INSERT INTO test.tb1 (id , name ) values ( ? , ? )';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 655372
Current database: test
Query OK, 0 rows affected (0.01 sec)
直连observer 执行 prepare 不会出现断链现场:
MySQL [test]> prepare stmt1 from 'INSERT INTO test.tb1 (id , name ) values ( ? , ? )';
Query OK, 0 rows affected (0.01 sec)
MySQL [test]> prepare stmt1 from 'INSERT INTO test.tb1 (id , name ) values ( ? , ? )';
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> prepare stmt1 from 'INSERT INTO test.tb1 (id , name ) values ( ? , ? )';
Query OK, 0 rows affected (0.00 sec)
obproxy_error日志内容如下:
[time],undefined,,,,[clustername]:sys:test,OB_MYSQL,tb1,tb1,OB_MYSQL_COM_QUERY,TEXT_PS_PREPARE,failed,-4016,prepare stmt1 from 'INSERT INTO test.tb1 (id %2C name ) values ( ? %2C ? )',118us,0us,0us,0us,Y0-7F7D0BE0D3A0,,,,0,,Ooooooooooooops
目前文本PS功能还有缺陷,需要等待后续版本修复