Merging binlog router into beta refresh

This commit is contained in:
Mark Riddoch
2014-12-05 11:30:03 +00:00
parent de3b2db904
commit 2b998eb17f
7 changed files with 79 additions and 37 deletions

View File

@ -93,6 +93,7 @@ blr_start_master(ROUTER_INSTANCE *router)
DCB *client;
GWBUF *buf;
router->stats.n_binlogs_ses = 0;
if ((client = dcb_alloc(DCB_ROLE_INTERNAL)) == NULL)
{
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
@ -101,6 +102,7 @@ GWBUF *buf;
}
router->client = client;
client->data = CreateMySQLAuthData(router->user, router->password, "");
client->state = DCB_STATE_POLLING; // Lie to keep the protocol module happy
if ((router->session = session_alloc(router->service, client)) == NULL)
{
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
@ -279,7 +281,11 @@ char query[128];
// Response to fetch of master's server-id
router->saved_master.server_id = buf;
// TODO: Extract the value of server-id and place in router->master_id
buf = blr_make_query("SET @master_heartbeat_period = 1799999979520");
{
char str[80];
sprintf(str, "SET @master_heartbeat_period = %lu000000000", router->heartbeat);
buf = blr_make_query(str);
}
router->master_state = BLRM_HBPERIOD;
router->master->func.write(router->master, buf);
break;
@ -654,6 +660,7 @@ static REP_HEADER phdr;
if (hdr.ok == 0)
{
router->stats.n_binlogs++;
router->stats.n_binlogs_ses++;
router->lastEventReceived = hdr.event_type;
// #define SHOW_EVENTS