MXS-1075: added blr_fetch_mariadb_gtid() routine
Added generic blr_fetch_mariadb_gtid() routine inst->binlog_name is now stored into MARIADB_GTID_INFO struct. (it was missing)
This commit is contained in:
@ -2734,6 +2734,7 @@ static void mariadb_gtid_info_free(MARIADB_GTID_INFO *in)
|
|||||||
if (in)
|
if (in)
|
||||||
{
|
{
|
||||||
MXS_FREE(in->gtid);
|
MXS_FREE(in->gtid);
|
||||||
|
MXS_FREE(in->file);
|
||||||
MXS_FREE(in);
|
MXS_FREE(in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2752,9 +2753,11 @@ static MARIADB_GTID_INFO *mariadb_gtid_info_dup(const MARIADB_GTID_INFO *in)
|
|||||||
{
|
{
|
||||||
MXS_FREE(rval);
|
MXS_FREE(rval);
|
||||||
MXS_FREE(gtid);
|
MXS_FREE(gtid);
|
||||||
|
MXS_FREE(file);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
rval->gtid = gtid;
|
rval->gtid = gtid;
|
||||||
|
rval->file = file;
|
||||||
rval->start = in-> start;
|
rval->start = in-> start;
|
||||||
rval->end = in->end;
|
rval->end = in->end;
|
||||||
|
|
||||||
|
|||||||
@ -3311,6 +3311,7 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE *inst)
|
|||||||
MARIADB_GTID_INFO gtid_info;
|
MARIADB_GTID_INFO gtid_info;
|
||||||
|
|
||||||
gtid_info.gtid = inst->pending_transaction.gtid;
|
gtid_info.gtid = inst->pending_transaction.gtid;
|
||||||
|
gtid_info.file = inst->binlog_name;
|
||||||
gtid_info.start = inst->pending_transaction.start_pos;
|
gtid_info.start = inst->pending_transaction.start_pos;
|
||||||
gtid_info.end = inst->pending_transaction.end_pos;
|
gtid_info.end = inst->pending_transaction.end_pos;
|
||||||
|
|
||||||
@ -3333,3 +3334,23 @@ bool blr_save_mariadb_gtid(ROUTER_INSTANCE *inst)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get MariaDB GTID frim repo
|
||||||
|
*
|
||||||
|
* @param inst The router instance
|
||||||
|
* @return Found data or NULL
|
||||||
|
*/
|
||||||
|
|
||||||
|
MARIADB_GTID_INFO *blr_fetch_mariadb_gtid(ROUTER_INSTANCE *inst, char *gtid)
|
||||||
|
{
|
||||||
|
if (!gtid)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (MARIADB_GTID_INFO *)hashtable_fetch(inst->gtid_repo,
|
||||||
|
gtid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -166,6 +166,7 @@ static int blr_slave_send_heartbeat(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave
|
|||||||
static int blr_set_master_ssl(ROUTER_INSTANCE *router, CHANGE_MASTER_OPTIONS config, char *error_message);
|
static int blr_set_master_ssl(ROUTER_INSTANCE *router, CHANGE_MASTER_OPTIONS config, char *error_message);
|
||||||
static int blr_slave_read_ste(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, uint32_t fde_end_pos);
|
static int blr_slave_read_ste(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, uint32_t fde_end_pos);
|
||||||
static GWBUF *blr_slave_read_fde(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave);
|
static GWBUF *blr_slave_read_fde(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave);
|
||||||
|
extern MARIADB_GTID_INFO *blr_fetch_mariadb_gtid(ROUTER_INSTANCE *inst, char *gtid);
|
||||||
|
|
||||||
void poll_fake_write_event(DCB *dcb);
|
void poll_fake_write_event(DCB *dcb);
|
||||||
|
|
||||||
@ -2297,8 +2298,9 @@ blr_slave_binlog_dump(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue
|
|||||||
/* Shall we avoid the lookup if file & pos is set? */
|
/* Shall we avoid the lookup if file & pos is set? */
|
||||||
|
|
||||||
/* Fetch the GTID from the storage */
|
/* Fetch the GTID from the storage */
|
||||||
MARIADB_GTID_INFO *f_gtid = hashtable_fetch(router->gtid_repo,
|
MARIADB_GTID_INFO *f_gtid = blr_fetch_mariadb_gtid(router,
|
||||||
slave->mariadb_gtid);
|
slave->mariadb_gtid);
|
||||||
|
|
||||||
/* Not Found */
|
/* Not Found */
|
||||||
if (!f_gtid)
|
if (!f_gtid)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user