MySQL replication--slave settings read the Binlog location

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.