buf_flush_page_cleaner_thread

MySQL源码分析
yzs87
while (srv_shutdown_state == SRV_SHUTDOWN_NONE) {
    //1 server active或者有挂起的读IO请求或者n_flushed==0
    //  sleep 1微妙
    if (srv_check_activity(last_activity)
		    || buf_get_n_pending_read_ios()
		    || n_flushed == 0) {
			page_cleaner_sleep_if_needed(next_loop_time);
    }
    //2
    next_loop_time = ut_time_ms() + 1000;
    if (srv_check_activity(last_activity)) {
        last_activity = srv_get_activity_count();
        //2.1
        n_flushed = buf_flush_LRU_tail();
        //2.2
        n_flushed += page_cleaner_flush_pages_if_needed();
    }else{
        n_flushed = page_cleaner_do_flush_batch(PCT_IO(100),LSN_MAX);
        //刷srv_io_capacity个即200个page
        //page_cleaner_do_flush_batch->buf_flush_list->buf_flush_batch->
        //buf_do_flush_list_batch: 刷flush_list脏页
    }
}

注:

PCT_IO(100)

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 博客之星2020 设计师:CY__ 返回首页
实付 9.90元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值