Creating BaseHGC (Base HostGroup Container)

v2.x_pg_PrepStmtBase_240714
Rene Cannao 2 years ago
parent cf61603375
commit a593f215d1

@ -1,9 +1,12 @@
template <typename HGC> class BaseSrvList;
template <typename HGC> class BaseHGC;
class MyHGC;
class PgSQL_HGC;
class MySrvC;
class PgSQL_SrvC;
class MySrvList;
class PgSQL_SrvList;
#include "proxysql.h"
#include "cpp.h"
@ -317,6 +320,9 @@ class BaseHGC { // MySQL Host Group Container
time_t last_log_time_num_online_servers;
unsigned long long current_time_now;
uint32_t new_connections_now;
using TypeSrvList = typename std::conditional<
std::is_same_v<HGC, MyHGC>, MySrvList, PgSQL_SrvList
>::type;
BaseSrvList<HGC> *mysrvs;
struct { // this is a series of attributes specific for each hostgroup
char * init_connect;
@ -351,10 +357,10 @@ class BaseHGC { // MySQL Host Group Container
BaseHGC(int);
virtual ~BaseHGC();
using TypeSrvC = typename std::conditional<
std::is_same_v<HGC, MyHGC>, std::variant<MySrvC>, std::variant<PgSQL_SrvC>
std::is_same_v<HGC, MyHGC>, MySrvC, PgSQL_SrvC
>::type;
using TypeSess = typename std::conditional<
std::is_same_v<HGC, MyHGC>, std::variant<MySQL_Session>, std::variant<PgSQL_Session>
std::is_same_v<HGC, MyHGC>, MySQL_Session, PgSQL_Session
>::type;
TypeSess *get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_lag_ms, TypeSess *sess);
void refresh_online_server_count();

@ -293,6 +293,14 @@ class MySrvList: public BaseSrvList<MyHGC> { // MySQL Server List
#endif // 0
};
class MyHGC: public BaseHGC<MyHGC> {
public:
MyHGC(int _hid) : BaseHGC<MyHGC>(_hid) {}
MySrvC *get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_lag_ms, MySQL_Session *sess);
};
#if 0
class MyHGC { // MySQL Host Group Container
public:
unsigned int hid;
@ -342,6 +350,7 @@ class MyHGC { // MySQL Host Group Container
return false;
}
};
#endif // 0
class Group_Replication_Info {
public:

@ -261,6 +261,14 @@ class PgSQL_SrvList: public BaseSrvList<PgSQL_HGC> {
friend class PgSQL_HGC;
};
class PgSQL_HGC: public BaseHGC<PgSQL_HGC> {
public:
PgSQL_HGC(int _hid) : BaseHGC<PgSQL_HGC>(_hid) {}
PgSQL_SrvC *get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_lag_ms, PgSQL_Session *sess);
};
#if 0
class PgSQL_HGC { // MySQL Host Group Container
public:
unsigned int hid;
@ -296,6 +304,7 @@ class PgSQL_HGC { // MySQL Host Group Container
~PgSQL_HGC();
PgSQL_SrvC *get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_lag_ms, PgSQL_Session *sess);
};
#endif // 0
class PgSQL_Group_Replication_Info {
public:

@ -0,0 +1,479 @@
#include "../deps/json/json.hpp"
using json = nlohmann::json;
#define PROXYJSON
#include "Base_HostGroups_Manager.h"
template BaseHGC<MyHGC>::BaseHGC(int);
template BaseHGC<MyHGC>::~BaseHGC();
template void BaseHGC<MyHGC>::log_num_online_server_count_error();
template void BaseHGC<MyHGC>::reset_attributes();
template void BaseHGC<MyHGC>::refresh_online_server_count();
template BaseHGC<PgSQL_HGC>::BaseHGC(int);
template BaseHGC<PgSQL_HGC>::~BaseHGC();
template void BaseHGC<PgSQL_HGC>::log_num_online_server_count_error();
template void BaseHGC<PgSQL_HGC>::reset_attributes();
template void BaseHGC<PgSQL_HGC>::refresh_online_server_count();
template<typename HGC>
using TypeSrvC = typename std::conditional<
std::is_same_v<HGC, MyHGC>, MySrvC, PgSQL_SrvC
>::type;
template<typename HGC>
using TypeSess = typename std::conditional<
std::is_same_v<HGC, MyHGC>, MySQL_Session, PgSQL_Session
>::type;
#include "MySQL_HostGroups_Manager.h"
#ifdef TEST_AURORA
if constexpr (std::is_same_v<HGC, MyHGC>) {
static unsigned long long array_mysrvc_total = 0;
static unsigned long long array_mysrvc_cands = 0;
}
#endif // TEST_AURORA
extern MySQL_Threads_Handler *GloMTH;
template<typename HGC>
BaseHGC<HGC>::BaseHGC(int _hid) {
hid=_hid;
if constexpr (std::is_same_v<HGC, MyHGC>) {
mysrvs=new MySrvList(static_cast<HGC*>(this));
} else if constexpr (std::is_same_v<HGC, PgSQL_HGC>) {
mysrvs=new PgSQL_SrvList(static_cast<HGC*>(this));
} else {
assert(0);
}
current_time_now = 0;
new_connections_now = 0;
attributes.initialized = false;
reset_attributes();
// Uninitialized server defaults. Should later be initialized via 'mysql_hostgroup_attributes'.
servers_defaults.weight = -1;
servers_defaults.max_connections = -1;
servers_defaults.use_ssl = -1;
num_online_servers.store(0, std::memory_order_relaxed);;
last_log_time_num_online_servers = 0;
}
template<typename HGC>
void BaseHGC<HGC>::reset_attributes() {
if (attributes.initialized == false) {
attributes.init_connect = NULL;
attributes.comment = NULL;
attributes.ignore_session_variables_text = NULL;
}
attributes.initialized = true;
attributes.configured = false;
attributes.max_num_online_servers = 1000000;
attributes.throttle_connections_per_sec = 1000000;
attributes.autocommit = -1;
attributes.free_connections_pct = 10;
attributes.handle_warnings = -1;
attributes.monitor_slave_lag_when_null = -1;
attributes.multiplex = true;
attributes.connection_warming = false;
free(attributes.init_connect);
attributes.init_connect = NULL;
free(attributes.comment);
attributes.comment = NULL;
free(attributes.ignore_session_variables_text);
attributes.ignore_session_variables_text = NULL;
if (attributes.ignore_session_variables_json) {
delete attributes.ignore_session_variables_json;
attributes.ignore_session_variables_json = NULL;
}
}
template<typename HGC>
BaseHGC<HGC>::~BaseHGC() {
reset_attributes(); // free all memory
delete mysrvs;
}
#if 0
template<typename HGC>
TypeSrvC *BaseHGC<HGC>::get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_lag_ms, TypeSess *sess) {
MySrvC *mysrvc=NULL;
unsigned int j;
unsigned int sum=0;
unsigned int TotalUsedConn=0;
unsigned int l=mysrvs->cnt();
static time_t last_hg_log = 0;
#ifdef TEST_AURORA
if constexpr (std::is_same_v<HGC, MyHGC>) {
unsigned long long a1 = array_mysrvc_total/10000;
array_mysrvc_total += l;
unsigned long long a2 = array_mysrvc_total/10000;
if (a2 > a1) {
fprintf(stderr, "Total: %llu, Candidates: %llu\n", array_mysrvc_total-l, array_mysrvc_cands);
}
}
#endif // TEST_AURORA
TypeSrvC *mysrvcCandidates_static[32];
TypeSrvC **mysrvcCandidates = mysrvcCandidates_static;
unsigned int num_candidates = 0;
bool max_connections_reached = false;
if (l>32) {
mysrvcCandidates = (TypeSrvC **)malloc(sizeof(TypeSrvC *)*l);
}
if (l) {
//int j=0;
for (j=0; j<l; j++) {
mysrvc=mysrvs->idx(j);
if (mysrvc->get_status() == MYSQL_SERVER_STATUS_ONLINE) { // consider this server only if ONLINE
if (mysrvc->myhgc->num_online_servers.load(std::memory_order_relaxed) <= mysrvc->myhgc->attributes.max_num_online_servers) { // number of online servers in HG is within configured range
if (mysrvc->ConnectionsUsed->conns_length() < mysrvc->max_connections) { // consider this server only if didn't reach max_connections
if (mysrvc->current_latency_us < (mysrvc->max_latency_us ? mysrvc->max_latency_us : mysql_thread___default_max_latency_ms*1000)) { // consider the host only if not too far
if (gtid_trxid) {
if (MyHGM->gtid_exists(mysrvc, gtid_uuid, gtid_trxid)) {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
} else {
if (max_lag_ms >= 0) {
if ((unsigned int)max_lag_ms >= mysrvc->aws_aurora_current_lag_us / 1000) {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
} else {
sess->thread->status_variables.stvar[st_var_aws_aurora_replicas_skipped_during_query]++;
}
} else {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
}
}
} else {
max_connections_reached = true;
}
} else {
mysrvc->myhgc->log_num_online_server_count_error();
}
} else {
if (mysrvc->get_status() == MYSQL_SERVER_STATUS_SHUNNED) {
// try to recover shunned servers
if (mysrvc->shunned_automatic && mysql_thread___shun_recovery_time_sec) {
time_t t;
t=time(NULL);
// we do all these changes without locking . We assume the server is not used from long
// even if the server is still in used and any of the follow command fails it is not critical
// because this is only an attempt to recover a server that is probably dead anyway
// the next few lines of code try to solve issue #530
int max_wait_sec = ( mysql_thread___shun_recovery_time_sec * 1000 >= mysql_thread___connect_timeout_server_max ? mysql_thread___connect_timeout_server_max/1000 - 1 : mysql_thread___shun_recovery_time_sec );
if (max_wait_sec < 1) { // min wait time should be at least 1 second
max_wait_sec = 1;
}
if (t > mysrvc->time_last_detected_error && (t - mysrvc->time_last_detected_error) > max_wait_sec) {
if (
(mysrvc->shunned_and_kill_all_connections==false) // it is safe to bring it back online
||
(mysrvc->shunned_and_kill_all_connections==true && mysrvc->ConnectionsUsed->conns_length()==0 && mysrvc->ConnectionsFree->conns_length()==0) // if shunned_and_kill_all_connections is set, ensure all connections are already dropped
) {
#ifdef DEBUG
if (GloMTH->variables.hostgroup_manager_verbose >= 3) {
proxy_info("Unshunning server %s:%d.\n", mysrvc->address, mysrvc->port);
}
#endif
mysrvc->set_status(MYSQL_SERVER_STATUS_ONLINE);
mysrvc->shunned_automatic=false;
mysrvc->shunned_and_kill_all_connections=false;
mysrvc->connect_ERR_at_time_last_detected_error=0;
mysrvc->time_last_detected_error=0;
// note: the following function scans all the hostgroups.
// This is ok for now because we only have a global mutex.
// If one day we implement a mutex per hostgroup (unlikely,
// but possible), this must be taken into consideration
if (mysql_thread___unshun_algorithm == 1) {
MyHGM->unshun_server_all_hostgroups(mysrvc->address, mysrvc->port, t, max_wait_sec, &mysrvc->myhgc->hid);
}
// if a server is taken back online, consider it immediately
if ( mysrvc->current_latency_us < ( mysrvc->max_latency_us ? mysrvc->max_latency_us : mysql_thread___default_max_latency_ms*1000 ) ) { // consider the host only if not too far
if (gtid_trxid) {
if (MyHGM->gtid_exists(mysrvc, gtid_uuid, gtid_trxid)) {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
} else {
if (max_lag_ms >= 0) {
if ((unsigned int)max_lag_ms >= mysrvc->aws_aurora_current_lag_us/1000) {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
} else {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
}
}
}
}
}
}
}
}
if (max_lag_ms > 0) { // we are using AWS Aurora, as this logic is implemented only here
unsigned int min_num_replicas = sess->thread->variables.aurora_max_lag_ms_only_read_from_replicas;
if (min_num_replicas) {
if (num_candidates >= min_num_replicas) { // there are at least N replicas
// we try to remove the writer
unsigned int total_aws_aurora_current_lag_us=0;
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
total_aws_aurora_current_lag_us += mysrvc->aws_aurora_current_lag_us;
}
if (total_aws_aurora_current_lag_us) { // we are just double checking that we don't have all servers with aws_aurora_current_lag_us==0
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
if (mysrvc->aws_aurora_current_lag_us==0) {
sum-=mysrvc->weight;
TotalUsedConn-=mysrvc->ConnectionsUsed->conns_length();
if (j < num_candidates-1) {
mysrvcCandidates[j]=mysrvcCandidates[num_candidates-1];
}
num_candidates--;
}
}
}
}
}
}
if (sum==0) {
// per issue #531 , we try a desperate attempt to bring back online any shunned server
// we do this lowering the maximum wait time to 10%
// most of the follow code is copied from few lines above
time_t t;
t=time(NULL);
int max_wait_sec = ( mysql_thread___shun_recovery_time_sec * 1000 >= mysql_thread___connect_timeout_server_max ? mysql_thread___connect_timeout_server_max/10000 - 1 : mysql_thread___shun_recovery_time_sec/10 );
if (max_wait_sec < 1) { // min wait time should be at least 1 second
max_wait_sec = 1;
}
if (t - last_hg_log > 1) { // log this at most once per second to avoid spamming the logs
last_hg_log = time(NULL);
if (gtid_trxid) {
proxy_error("Hostgroup %u has no servers ready for GTID '%s:%ld'. Waiting for replication...\n", hid, gtid_uuid, gtid_trxid);
} else {
proxy_error("Hostgroup %u has no servers available%s! Checking servers shunned for more than %u second%s\n", hid,
(max_connections_reached ? " or max_connections reached for all servers" : ""), max_wait_sec, max_wait_sec == 1 ? "" : "s");
}
}
for (j=0; j<l; j++) {
mysrvc=mysrvs->idx(j);
if (mysrvc->get_status() == MYSQL_SERVER_STATUS_SHUNNED && mysrvc->shunned_automatic == true) {
if ((t - mysrvc->time_last_detected_error) > max_wait_sec) {
mysrvc->set_status(MYSQL_SERVER_STATUS_ONLINE);
mysrvc->shunned_automatic=false;
mysrvc->connect_ERR_at_time_last_detected_error=0;
mysrvc->time_last_detected_error=0;
// if a server is taken back online, consider it immediately
if ( mysrvc->current_latency_us < ( mysrvc->max_latency_us ? mysrvc->max_latency_us : mysql_thread___default_max_latency_ms*1000 ) ) { // consider the host only if not too far
if (gtid_trxid) {
if (MyHGM->gtid_exists(mysrvc, gtid_uuid, gtid_trxid)) {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
} else {
if (max_lag_ms >= 0) {
if ((unsigned int)max_lag_ms >= mysrvc->aws_aurora_current_lag_us/1000) {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
} else {
sum+=mysrvc->weight;
TotalUsedConn+=mysrvc->ConnectionsUsed->conns_length();
mysrvcCandidates[num_candidates]=mysrvc;
num_candidates++;
}
}
}
}
}
}
}
if (sum==0) {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning MySrvC NULL because no backend ONLINE or with weight\n");
if (l>32) {
free(mysrvcCandidates);
}
#ifdef TEST_AURORA
array_mysrvc_cands += num_candidates;
#endif // TEST_AURORA
return NULL; // if we reach here, we couldn't find any target
}
/*
unsigned int New_sum=0;
unsigned int New_TotalUsedConn=0;
// we will now scan again to ignore overloaded servers
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
unsigned int len=mysrvc->ConnectionsUsed->conns_length();
if ((len * sum) <= (TotalUsedConn * mysrvc->weight * 1.5 + 1)) {
New_sum+=mysrvc->weight;
New_TotalUsedConn+=len;
} else {
// remove the candidate
if (j+1 < num_candidates) {
mysrvcCandidates[j] = mysrvcCandidates[num_candidates-1];
}
j--;
num_candidates--;
}
}
*/
unsigned int New_sum=sum;
if (New_sum==0) {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning MySrvC NULL because no backend ONLINE or with weight\n");
if (l>32) {
free(mysrvcCandidates);
}
#ifdef TEST_AURORA
array_mysrvc_cands += num_candidates;
#endif // TEST_AURORA
return NULL; // if we reach here, we couldn't find any target
}
// latency awareness algorithm is enabled only when compiled with USE_MYSRVC_ARRAY
if (sess && sess->thread->variables.min_num_servers_lantency_awareness) {
if ((int) num_candidates >= sess->thread->variables.min_num_servers_lantency_awareness) {
unsigned int servers_with_latency = 0;
unsigned int total_latency_us = 0;
// scan and verify that all servers have some latency
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
if (mysrvc->current_latency_us) {
servers_with_latency++;
total_latency_us += mysrvc->current_latency_us;
}
}
if (servers_with_latency == num_candidates) {
// all servers have some latency.
// That is good. If any server have no latency, something is wrong
// and we will skip this algorithm
sess->thread->status_variables.stvar[st_var_ConnPool_get_conn_latency_awareness]++;
unsigned int avg_latency_us = 0;
avg_latency_us = total_latency_us/num_candidates;
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
if (mysrvc->current_latency_us > avg_latency_us) {
// remove the candidate
if (j+1 < num_candidates) {
mysrvcCandidates[j] = mysrvcCandidates[num_candidates-1];
}
j--;
num_candidates--;
}
}
// we scan again to adjust weight
New_sum = 0;
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
New_sum+=mysrvc->weight;
}
}
}
}
unsigned int k;
if (New_sum > 32768) {
k=rand()%New_sum;
} else {
k=fastrand()%New_sum;
}
k++;
New_sum=0;
for (j=0; j<num_candidates; j++) {
mysrvc = mysrvcCandidates[j];
New_sum+=mysrvc->weight;
if (k<=New_sum) {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning MySrvC %p, server %s:%d\n", mysrvc, mysrvc->address, mysrvc->port);
if (l>32) {
free(mysrvcCandidates);
}
#ifdef TEST_AURORA
array_mysrvc_cands += num_candidates;
#endif // TEST_AURORA
return mysrvc;
}
}
} else {
time_t t = time(NULL);
if (t - last_hg_log > 1) {
last_hg_log = time(NULL);
proxy_error("Hostgroup %u has no servers available!\n", hid);
}
}
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Returning MySrvC NULL\n");
if (l>32) {
free(mysrvcCandidates);
}
#ifdef TEST_AURORA
array_mysrvc_cands += num_candidates;
#endif // TEST_AURORA
return NULL; // if we reach here, we couldn't find any target
}
#endif // 0
template<typename HGC>
void BaseHGC<HGC>::refresh_online_server_count() {
if (__sync_fetch_and_add(&glovars.shutdown, 0) != 0)
return;
#ifdef DEBUG
assert(MyHGM->is_locked);
#endif
unsigned int online_servers_count = 0;
if constexpr (std::is_same_v<HGC, MyHGC>) { // FIXME: this logic for now is enabled only for MySQL
for (unsigned int i = 0; i < mysrvs->servers->len; i++) {
TypeSrvC* mysrvc = (TypeSrvC*)mysrvs->servers->index(i);
if (mysrvc->get_status() == MYSQL_SERVER_STATUS_ONLINE) {
online_servers_count++;
}
}
}
num_online_servers.store(online_servers_count, std::memory_order_relaxed);
}
template<typename HGC>
void BaseHGC<HGC>::log_num_online_server_count_error() {
const time_t curtime = time(NULL);
// if this is the first time the method is called or if more than 10 seconds have passed since the last log
if (last_log_time_num_online_servers == 0 ||
((curtime - last_log_time_num_online_servers) > 10)) {
last_log_time_num_online_servers = curtime;
proxy_error(
"Number of online servers detected in a hostgroup exceeds the configured maximum online servers. hostgroup:%u, num_online_servers:%u, max_online_servers:%u\n",
hid, num_online_servers.load(std::memory_order_relaxed), attributes.max_num_online_servers);
}
}

@ -138,7 +138,7 @@ default: libproxysql.a
_OBJ_CXX := ProxySQL_GloVars.oo network.oo debug.oo configfile.oo Query_Cache.oo SpookyV2.oo MySQL_Authentication.oo gen_utils.oo sqlite3db.oo mysql_connection.oo MySQL_HostGroups_Manager.oo mysql_data_stream.oo MySQL_Thread.oo MySQL_Session.oo MySQL_Protocol.oo mysql_backend.oo Query_Processor.oo ProxySQL_Admin.oo ProxySQL_Config.oo ProxySQL_Restapi.oo MySQL_Monitor.oo MySQL_Logger.oo thread.oo MySQL_PreparedStatement.oo ProxySQL_Cluster.oo ClickHouse_Authentication.oo ClickHouse_Server.oo ProxySQL_Statistics.oo Chart_bundle_js.oo ProxySQL_HTTP_Server.oo ProxySQL_RESTAPI_Server.oo font-awesome.min.css.oo main-bundle.min.css.oo set_parser.oo MySQL_Variables.oo c_tokenizer.oo proxysql_utils.oo proxysql_coredump.oo proxysql_sslkeylog.oo \
sha256crypt.oo \
BaseSrvList.oo Base_HostGroups_Manager.oo \
BaseSrvList.oo BaseHGC.oo Base_HostGroups_Manager.oo \
QP_rule_text.oo QP_query_digest_stats.oo \
GTID_Server_Data.oo MyHGC.oo MySrvConnList.oo MySrvList.oo MySrvC.oo \
MySQL_encode.oo MySQL_ResultSet.oo \

@ -11,6 +11,7 @@ static unsigned long long array_mysrvc_cands = 0;
extern MySQL_Threads_Handler *GloMTH;
#if 0
MyHGC::MyHGC(int _hid) {
hid=_hid;
mysrvs=new MySrvList(this);
@ -58,7 +59,7 @@ MyHGC::~MyHGC() {
reset_attributes(); // free all memory
delete mysrvs;
}
#endif // 0
MySrvC *MyHGC::get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_lag_ms, MySQL_Session *sess) {
MySrvC *mysrvc=NULL;
unsigned int j;
@ -401,6 +402,7 @@ MySrvC *MyHGC::get_random_MySrvC(char * gtid_uuid, uint64_t gtid_trxid, int max_
return NULL; // if we reach here, we couldn't find any target
}
#if 0
void MyHGC::refresh_online_server_count() {
if (__sync_fetch_and_add(&glovars.shutdown, 0) != 0)
return;
@ -428,3 +430,4 @@ void MyHGC::log_num_online_server_count_error() {
hid, num_online_servers.load(std::memory_order_relaxed), attributes.max_num_online_servers);
}
}
#endif // 0

@ -935,7 +935,6 @@ PgSQL_SrvList::~PgSQL_SrvList() {
}
delete servers;
}
#endif // 0
PgSQL_HGC::PgSQL_HGC(int _hid) {
hid=_hid;
@ -981,6 +980,7 @@ PgSQL_HGC::~PgSQL_HGC() {
reset_attributes(); // free all memory
delete mysrvs;
}
#endif // 0
using metric_name = std::string;
using metric_help = std::string;

Loading…
Cancel
Save