19 #ifdef HAVE_REPLICATION
21 #include <my_global.h>
24 #define DEFAULT_CONNECT_RETRY 60
30 class Rpl_info_factory;
66 friend class Rpl_info_factory;
72 char host[HOSTNAME_LENGTH + 1];
78 bool start_user_configured;
82 char user[USERNAME_LENGTH + 1];
86 char password[MAX_PASSWORD_LENGTH + 1];
90 char start_user[USERNAME_LENGTH + 1];
94 char start_password[MAX_PASSWORD_LENGTH + 1];
98 char start_plugin_auth[FN_REFLEN + 1];
103 char start_plugin_dir[FN_REFLEN + 1];
112 bool is_start_user_configured()
const
114 return start_user_configured;
121 bool is_start_plugin_auth_configured()
const
123 return (start_plugin_auth[0] != 0);
130 bool is_start_plugin_dir_configured()
const
132 return (start_plugin_dir[0] != 0);
140 void set_start_user_configured(
bool config)
142 start_user_configured= config;
151 void set_user(
const char* user_arg)
153 if (user_arg && start_user_configured)
155 strmake(start_user, user_arg,
sizeof(start_user) - 1);
159 strmake(user, user_arg,
sizeof(user) - 1);
167 size_t get_user_size()
const
169 return (start_user_configured ?
sizeof(start_user) :
sizeof(user));
177 const char *get_user()
const
179 return start_user_configured ? start_user : user;
191 bool set_password(
const char* password_arg,
int password_arg_size);
200 bool get_password(
char *password_arg,
int *password_arg_size);
204 void reset_start_info();
210 const char *get_start_plugin_auth()
212 return start_plugin_auth;
219 const char *get_start_plugin_dir()
221 return start_plugin_dir;
228 void set_plugin_auth(
const char* src)
231 strmake(start_plugin_auth, src,
sizeof(start_plugin_auth) - 1);
238 void set_plugin_dir(
const char* src)
241 strmake(start_plugin_dir, src,
sizeof(start_plugin_dir) - 1);
245 char ssl_ca[FN_REFLEN], ssl_capath[FN_REFLEN], ssl_cert[FN_REFLEN];
246 char ssl_cipher[FN_REFLEN], ssl_key[FN_REFLEN];
247 char ssl_crl[FN_REFLEN], ssl_crlpath[FN_REFLEN];
248 my_bool ssl_verify_server_cert;
264 long clock_diff_with_master;
265 float heartbeat_period;
266 ulonglong received_heartbeats;
268 time_t last_heartbeat;
278 uint8 checksum_alg_before_fd;
280 char master_uuid[UUID_LENGTH+1];
281 char bind_addr[HOSTNAME_LENGTH+1];
283 ulong master_gtid_mode;
287 int flush_info(
bool force= FALSE);
290 bool shall_ignore_server_id(ulong s_id);
292 virtual ~Master_info();
295 char master_log_name[FN_REFLEN];
296 my_off_t master_log_pos;
299 void clear_in_memory_info(
bool all);
301 inline const char* get_master_log_name() {
return master_log_name; }
302 inline ulonglong get_master_log_pos() {
return master_log_pos; }
303 inline void set_master_log_name(
const char *log_file_name)
305 strmake(master_log_name, log_file_name,
sizeof(master_log_name) - 1);
307 inline void set_master_log_pos(ulonglong log_pos)
309 master_log_pos= log_pos;
311 inline const char* get_io_rpl_log_name()
313 return (master_log_name[0] ? master_log_name :
"FIRST");
315 static size_t get_number_info_mi_fields();
317 bool is_auto_position()
319 return auto_position;
322 void set_auto_position(
bool auto_position_param)
324 auto_position= auto_position_param;
351 return mi_description_event;
356 delete mi_description_event;
357 mi_description_event= fdle;
361 void init_master_log_pos();
363 bool read_info(Rpl_info_handler *from);
364 bool write_info(Rpl_info_handler *
to);
369 #ifdef HAVE_PSI_INTERFACE
370 PSI_mutex_key *param_key_info_run_lock,
371 PSI_mutex_key *param_key_info_data_lock,
372 PSI_mutex_key *param_key_info_sleep_lock,
373 PSI_mutex_key *param_key_info_data_cond,
374 PSI_mutex_key *param_key_info_start_cond,
375 PSI_mutex_key *param_key_info_stop_cond,
376 PSI_mutex_key *param_key_info_sleep_cond,
381 Master_info(
const Master_info& info);
382 Master_info& operator=(
const Master_info& info);
384 int change_master_server_id_cmp(ulong *id1, ulong *id2);