MySQL半同步复制--master dump线程2

mysql_binlog_send:
    //是否在binlog index文件中能够找到指定的binlog文件名
    if (mysql_bin_log.find_log_pos(&linfo, name, 1))
    ...
    if ((file=open_binlog_file(&log, log_file_name, &errmsg)) < 0)//打开binlog文件
    ...
    //初始化semi-sync
	if (RUN_HOOK(binlog_transmit, transmit_start,thd, flags, log_ident, pos, 
        &observe_transmission)))
    ...
    while (!net->error && net->vio != 0 && !thd->killed){//进入while循环
	//开始发送binlog之前需要重置packet(reset_transmit_packet)
	    if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg,observe_transmission))
        //会调用RUN_HOOK(binlog_transmit, reserve_header, (thd, flags, packet)))


        while (!thd->killed &&
           !(error= Log_event::read_log_event(&log, packet, log_lock,
                current_checksum_alg,log_file_name,&is_active_binlog))){
		   
           if (observe_transmission && 
               RUN_HOOK(binlog_transmit, b

你可能感兴趣的:(MySQL源码分析,MySQL源码研究)