MXS-1156: Store master_heartbeat_period in master.ini

MXS-1156: Store master_heartbeat_period in master.ini
This commit is contained in:
MassimilianoPinto 2017-08-28 09:35:59 +02:00
parent 0f5f9f8228
commit 3c7a0014a9
3 changed files with 11 additions and 1 deletions

View File

@ -1579,7 +1579,7 @@ diagnostics(MXS_ROUTER *router, DCB *dcb)
router_inst->binlogdir);
dcb_printf(dcb, "\tHeartbeat period (seconds): %lu%s\n",
router_inst->heartbeat,
router_inst->heartbeat ? "" : "(disabled)");
router_inst->heartbeat ? "" : " (disabled)");
dcb_printf(dcb, "\tNumber of master connects: %d\n",
router_inst->stats.n_masterstarts);
dcb_printf(dcb, "\tNumber of delayed reconnects: %d\n",
@ -2817,6 +2817,11 @@ blr_handle_config_item(const char *name, const char *value, ROUTER_INSTANCE *ins
}
}
}
/* Connect options */
else if (strcmp(name, "master_heartbeat_period") == 0)
{
inst->heartbeat = atol((char*)value);
}
else
{
return 0;

View File

@ -3167,6 +3167,9 @@ blr_file_write_master_config(ROUTER_INSTANCE *router, char *error)
fprintf(config_file, "master_tls_version=%s\n", ssl_version);
}
/* Connect options */
fprintf(config_file, "master_heartbeat_period=%lu\n", router->heartbeat);
fclose(config_file);
/* rename tmp file to right filename */

View File

@ -4711,6 +4711,8 @@ blr_master_apply_config(ROUTER_INSTANCE *router, MASTER_SERVER_CFG *prev_master)
MXS_FREE(router->fileroot);
router->fileroot = MXS_STRDUP_A(prev_master->filestem);
}
router->heartbeat = prev_master->heartbeat;
}
/**