Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V2.x Code cleanup in MySQL Hostgroups Manager #4078

Merged
merged 7 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions include/MySQL_HostGroups_Manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@

#include "ev.h"

#ifndef SPOOKYV2
#include "SpookyV2.h"
#define SPOOKYV2
#endif

#ifdef DEBUG
/* */
// Enabling STRESSTEST_POOL ProxySQL will do a lot of loops in the connection pool
Expand Down Expand Up @@ -570,6 +575,8 @@ class MySQL_HostGroups_Manager {
void wrunlock();
int servers_add(SQLite3_result *resultset);
bool commit(SQLite3_result* runtime_mysql_servers = nullptr, const std::string& checksum = "", const time_t epoch = 0);
void commit_update_checksums_from_tables(SpookyHash& myhash, bool& init);
void CUCFT1(SpookyHash& myhash, bool& init, const string& TableName, const string& ColumnName); // used by commit_update_checksums_from_tables()

/**
* @brief Store the resultset for the 'runtime_mysql_servers' table set that have been loaded to runtime.
Expand All @@ -583,23 +590,13 @@ class MySQL_HostGroups_Manager {
* Cluster to propagate current config.
* @param The resulset to be stored replacing the current one.
*/
void save_incoming_replication_hostgroups(SQLite3_result *);
void save_incoming_group_replication_hostgroups(SQLite3_result *);
void save_incoming_galera_hostgroups(SQLite3_result *);
void save_incoming_aws_aurora_hostgroups(SQLite3_result *);

SQLite3_result* get_current_mysql_servers_inner();
SQLite3_result* get_current_mysql_replication_hostgroups_inner();
SQLite3_result* get_current_mysql_group_replication_hostgroups_inner();
SQLite3_result* get_current_mysql_galera_hostgroups();
SQLite3_result* get_current_mysql_aws_aurora_hostgroups();
void save_incoming_mysql_table(SQLite3_result *, const string&);
SQLite3_result* get_current_mysql_table(const string& name);

SQLite3_result * execute_query(char *query, char **error);
SQLite3_result *dump_table_mysql_servers();
SQLite3_result *dump_table_mysql_replication_hostgroups();
SQLite3_result *dump_table_mysql_group_replication_hostgroups();
SQLite3_result *dump_table_mysql_galera_hostgroups();
SQLite3_result *dump_table_mysql_aws_aurora_hostgroups();
SQLite3_result *dump_table_mysql(const string&);

/**
* @brief Update the public member resulset 'mysql_servers_to_monitor'. This resulset should contain the latest
* 'mysql_servers' present in 'MySQL_HostGroups_Manager' db, which are not 'OFFLINE_HARD'. The resulset
Expand Down
13 changes: 3 additions & 10 deletions include/proxysql_admin.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,11 @@ class ProxySQL_Admin {
int load_debug_to_runtime();
void save_debug_from_runtime();
#endif // DEBUG

void flush_GENERIC__from_to(const std::string&, const std::string&);

void flush_mysql_users__from_memory_to_disk();
void flush_mysql_users__from_disk_to_memory();
void flush_mysql_servers__from_memory_to_disk();
void flush_mysql_servers__from_disk_to_memory();
void flush_mysql_query_rules__from_memory_to_disk();
void flush_mysql_query_rules__from_disk_to_memory();
void flush_mysql_firewall__from_memory_to_disk();
void flush_mysql_firewall__from_disk_to_memory();

// void flush_mysql_variables__from_disk_to_memory(); // commented in 2.3 because unused
void flush_mysql_variables__from_memory_to_disk();
Expand Down Expand Up @@ -408,8 +405,6 @@ class ProxySQL_Admin {

void load_scheduler_to_runtime();
void save_scheduler_runtime_to_database(bool);
void flush_scheduler__from_memory_to_disk();
void flush_scheduler__from_disk_to_memory();

void load_admin_variables_to_runtime(const std::string& checksum = "", const time_t epoch = 0) { flush_admin_variables___database_to_runtime(admindb, true, checksum, epoch); }
void save_admin_variables_from_runtime() { flush_admin_variables___runtime_to_database(admindb, true, true, false); }
Expand Down Expand Up @@ -463,8 +458,6 @@ class ProxySQL_Admin {

// Cluster
void load_proxysql_servers_to_runtime(bool _lock=true, const std::string& checksum = "", const time_t epoch = 0);
void flush_proxysql_servers__from_memory_to_disk();
void flush_proxysql_servers__from_disk_to_memory();
void save_proxysql_servers_runtime_to_database(bool);
void dump_checksums_values_table();

Expand Down
3 changes: 3 additions & 0 deletions lib/ClickHouse_Authentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
#include "proxysql.h"
#include "cpp.h"
#include "proxysql_atomic.h"
#ifndef SPOOKYV2
#include "SpookyV2.h"
#define SPOOKYV2
#endif

ClickHouse_Authentication::ClickHouse_Authentication() {
#ifdef DEBUG
Expand Down
3 changes: 3 additions & 0 deletions lib/ClickHouse_Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#include <resolv.h>
#include <arpa/inet.h>
#include <pthread.h>
#ifndef SPOOKYV2
#include "SpookyV2.h"
#define SPOOKYV2
#endif

#include <fcntl.h>
#include <sys/utsname.h>
Expand Down
3 changes: 3 additions & 0 deletions lib/MySQL_Authentication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

#include "MySQL_Authentication.hpp"

#ifndef SPOOKYV2
#include "SpookyV2.h"
#define SPOOKYV2
#endif

MySQL_Authentication::MySQL_Authentication() {
#ifdef DEBUG
Expand Down
Loading