zettadb / cluster_mgr

Clust_mgr is an important compnent of KunlunBase. It provides a HTTP API for KunlunBase users to do cluster management, provisioning and monitor work, so that uses can install a cluster, a kunlun-server node, a storage shard or a kunlun-storage node by calling such APIs. Such capability enables users to integrate KunlunBase management and provisioning as part of their existing application or GUIs. Cluster_mgr also provide other important cluster maintenance background work to make sure the KunlunBase clusters it serves can work efficiently and reliably.
http://www.kunlunbase.com
Apache License 2.0
10 stars 2 forks source link

Need to turn on the multi_statement option for executing mysql sql commands in cluster_mgr #30

Open jd-zhang opened 2 years ago

jd-zhang commented 2 years ago

Issue migrated from trac ticket # 747

component: cluster manager | priority: major

2022-05-26 19:22:46: zhangjindong@zettadb.com created the issue


error message:

2022-05-26 18:47:10.695415 <1290566> [error] [/home/kunlun/releasebuild/cluster_mgr/src/kl_mentain/shard.cc:503] mysql execute sql failed: execute query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET GLOBAL group_replication_bootstrap_group=ON; START GROUP_REPLICATION; SET GL' at line 1, error number: 1064, sql: stop group_replication; SET GLOBAL group_replication_bootstrap_group=ON; START GROUP_REPLICATION; SET GLOBAL group_replication_bootstrap_group=OFF

The issue is that, in the oldway, cluster_mgr connects to mysql uses CLIENT_MULTI_STATEMENTS option, so that it can execute multiple commands in a mysql_query call. But now, all mysql operations are done using op_mysql util, and it does not turn on this option for connecting mysql, so the command of start group replication command fails.