MXS-2011 Allow configurations to be modified

- When specifying a configuration, if it already exists use
  the existing configuration as the default, thus allowing you
  to change only a specific configuration value.
- When specifying a new alternative configuration, use the
  primary (aka first) configuration as the base.
- If MASTER_HOST is changed on the primary (first, nameless)
  configuration, then all configurations are erased.
- At "SLAVE START", always start from the first configuration.
This commit is contained in:
Johan Wikman
2018-09-03 18:46:05 +03:00
parent d293424f11
commit a70885a541
2 changed files with 63 additions and 14 deletions

View File

@ -424,6 +424,22 @@ public:
{
}
void set_defaults(const ChangeMasterConfig& config)
{
host = config.host;
port = std::to_string(config.port);
binlog_file = config.binlog_file;
user = config.user;
password = config.password;
ssl_key = config.ssl_key;
ssl_cert = config.ssl_cert;
ssl_ca = config.ssl_ca;
ssl_enabled = config.ssl_enabled ? "1" : "0";
use_mariadb10_gtid = config.use_mariadb10_gtid;
heartbeat_period = std::to_string(config.heartbeat_period);
connect_retry = std::to_string(config.connect_retry);
}
std::string connection_name;
std::string host;
std::string port;