Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Commit

Permalink
Avoid unnecessary buf_flush_list() in startup code path
Browse files Browse the repository at this point in the history
Summary:
Feature: Basic Performance Fixes

This is a performance regression bug in upstream code. Opened
Bug#70899 to track this.

In InnoDB startup code innobase_start_or_create_for_mysql()
after creating rsegs we flush the entire buffer pool. The
intent is to force trx_sys page to the disk. We can reach
this code path after doing recovery. In this case we can
potentially have millions of dirty pages in the buffer pool.
This can seriously increase the recovery time.

The fix is trivial. Check if we are coming from recovery code
path and don't flush buffer pool in that case because during
recovery we don't create rsegs.

Test Plan: run mtr

Reviewers: pivanof, steaphan, liang.guo.752

Reviewed By: steaphan

CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, pengt

Differential Revision: https://reviews.facebook.net/D16623
  • Loading branch information
inaam-rana authored and steaphangreene committed Mar 25, 2014
1 parent 8b6adf6 commit 766a90a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion storage/innobase/srv/srv0start.cc
Expand Up @@ -2589,7 +2589,9 @@ innobase_start_or_create_for_mysql(void)
}

/* Flush the changes made to TRX_SYS_PAGE by trx_sys_create_rsegs()*/
if (!srv_force_recovery && !srv_read_only_mode) {
if (!srv_force_recovery
&& !recv_needed_recovery
&& !srv_read_only_mode) {
bool success = buf_flush_list(ULINT_MAX, LSN_MAX, NULL);
ut_a(success);
buf_flush_wait_batch_end(NULL, BUF_FLUSH_LIST);
Expand Down

0 comments on commit 766a90a

Please sign in to comment.