Change_master->global_init_info->master_info::mi_init_info->rpl_info_handler::init_info->rpl_info_ File::d o_init_info->mi->rli->rli_init_info (), initialize./relay-bin.000001,4 If relay -log.info does not exist, otherwise read
Initialize Master_info structure int master_info::mi_init_info () { if (inited) dbug_return (0);// If you have already created a Master_info file, Exit handler->init_info () directly;//create/Open Master_info file if (check_return == repository_does_not_exist) {//if Master_ The info file is just created and the log location to be read is 4 init_master_log_pos (); |--master_log_name[0]= 0; |--master_log_pos= BIN_LOG_HEADER_SIZE; |--ssl_verify_server_cert= 0; |-- heartbeat_period= min<float> (Slave_max_heartbeat_period, (slave_net _timeout/2.0)); }else{ read_info (handler);//Read file } inited= 1; flush_info (TRUE); |--handler->set_sync_period (sync_ MASTERINFO_PERIOD);//default 10000 |--flush_io_cache (&info_file); |--my_sync (INFO_FD,&NBSP;MYF (MY_WME)); dbug_return ( 0);
int rpl_info_file::d o_init_info () { if (ret_check == repository_does_not_exist) { info_fd = my_open (info_fname, o_creat| o_rdwr| O_BINARY,&NBSP;MYF (MY_WME)); init_io_cache (& INFO_FILE,&NBSP;INFO_FD,&NBSP;IO_SIZE*2,&NBSP;READ_CACHE,&NBSP;0L,0,MYF (MY_WME)); }else if (ret_check == repository_exists) { info_fd = my_open (info_fname, o_rdwr| O_BINARY,&NBSP;MYF (MY_WME)); init_io_cache (& INFO_FILE,&NBSP;INFO_FD,&NBSP;IO_SIZE*2,&NBSP;READ_CACHE,&NBSP;0L,0,&NBSP;MYF (MY_WME)) } }
If Master.info does not exist, the corresponding Io_cache is created and initialized
If present, open and initialize the corresponding Io_cache
This article is from the "Yanzongshuai column" blog, be sure to keep this source http://yanzongshuai.blog.51cto.com/3057928/1970302
MySQL replication--slave settings read the Binlog location