Drafting tracking of GTID

pull/1404/merge
René Cannaò 8 years ago
parent 7c2d4e35d0
commit f0a2edce4a

@ -2,6 +2,7 @@
#define __CLASS_MYSQL_HOSTGROUPS_MANAGER_H
#include "proxysql.h"
#include "cpp.h"
#include "proxysql_gtid.h"
#include <thread>
@ -183,6 +184,9 @@ class MySQL_HostGroups_Manager {
std::thread *HGCU_thread;
std::unordered_map <string, Gtid_Server_Info *> gtid_map;
pthread_rwlock_t gtid_rwlock;
public:
struct {
unsigned int servers_table_version;

@ -0,0 +1,21 @@
#ifndef PROXYSQL_GTID
#define PROXYSQL_GTID
// highly inspired by libslave
// https://github.com/vozbu/libslave/
#include <unordered_map>
#include <list>
#include <utility>
typedef std::pair<std::string, int64_t> gtid_t;
typedef std::pair<int64_t, int64_t> gtid_interval_t;
typedef std::unordered_map<std::string, std::list<gtid_interval_t>> gtid_set_t;
class Gtid_Server_Info {
gtid_set_t executed_gtid_set;
char *address;
uint16_t mysql_port;
uint16_t gtid_port;
bool active;
};
#endif /* PROXYSQL_GTID */
Loading…
Cancel
Save