Prevent Cluster sync between nodes with/without 'ldap_auth' plugin loaded

pull/3921/head
Javier Jaramago Fernández 4 years ago
parent 134448f058
commit fa887b2dc9

@ -4476,18 +4476,34 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) {
if (!strncasecmp("SELECT @@version", query_no_space, strlen("SELECT @@version"))) {
l_free(query_length,query);
char *q=(char *)"SELECT '%s' AS '@@version'";
query_length=strlen(q)+20+strlen(PROXYSQL_VERSION);
if (GloMyLdapAuth == nullptr) {
query_length=strlen(q)+20+strlen(PROXYSQL_VERSION);
} else {
query_length=strlen(q)+20+strlen(PROXYSQL_VERSION)+strlen(" Enterprise");
}
query=(char *)l_alloc(query_length);
sprintf(query,q,PROXYSQL_VERSION);
if (GloMyLdapAuth == nullptr) {
sprintf(query, q, PROXYSQL_VERSION);
} else {
sprintf(query, q, PROXYSQL_VERSION" Enterprise");
}
goto __run_query;
}
if (!strncasecmp("SELECT version()", query_no_space, strlen("SELECT version()"))) {
l_free(query_length,query);
char *q=(char *)"SELECT '%s' AS 'version()'";
query_length=strlen(q)+20+strlen(PROXYSQL_VERSION);
if (GloMyLdapAuth == nullptr) {
query_length=strlen(q)+20+strlen(PROXYSQL_VERSION);
} else {
query_length=strlen(q)+20+strlen(PROXYSQL_VERSION)+strlen(" Enterprise");
}
query=(char *)l_alloc(query_length);
sprintf(query,q,PROXYSQL_VERSION);
if (GloMyLdapAuth == nullptr) {
sprintf(query, q, PROXYSQL_VERSION);
} else {
sprintf(query, q, PROXYSQL_VERSION" Enterprise");
}
goto __run_query;
}

@ -114,8 +114,9 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) {
bool same_version = false;
while ((row = mysql_fetch_row(result))) {
if (row[0]) {
if (strcmp(row[0], PROXYSQL_VERSION)==0) {
proxy_info("Cluster: clustering with peer %s:%d . Remote version: %s . Self version: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION);
const char* PROXYSQL_VERSION_ = GloMyLdapAuth == nullptr ? PROXYSQL_VERSION : PROXYSQL_VERSION" Enterprise";
if (strcmp(row[0], PROXYSQL_VERSION_)==0) {
proxy_info("Cluster: clustering with peer %s:%d . Remote version: %s . Self version: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION_);
same_version = true;
std::string q = "PROXYSQL CLUSTER_NODE_UUID ";
q += GloVars.uuid;
@ -126,7 +127,7 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) {
proxy_info("Cluster: sending CLUSTER_NODE_UUID %s to peer %s:%d\n", GloVars.uuid, node->hostname, node->port);
rc_query = mysql_query(conn, q.c_str());
} else {
proxy_warning("Cluster: different ProxySQL version with peer %s:%d . Remote: %s . Self: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION);
proxy_warning("Cluster: different ProxySQL version with peer %s:%d . Remote: %s . Self: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION_);
}
}
}

Loading…
Cancel
Save