Skip to content

Commit

Permalink
Revert part of MDEV-12113
Browse files Browse the repository at this point in the history
commit 1af8bf3 added unnecessary
calls to fil_write_flushed_lsn() during redo log resizing at
InnoDB server startup.

Because fil_write_flushed_lsn() is neither redo-logged nor doublewrite
buffered, the call is risky and should be avoided, because if the
server killed during the write call, the whole InnoDB instance can
become inaccessible (corrupted page 0 in the system tablespace).

In the best case, this call might prevent a diagnostic message from
being emitted to the error log on the next startup.
  • Loading branch information
dr-m committed Jun 8, 2017
1 parent 18f62d9 commit 68890fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
13 changes: 2 additions & 11 deletions storage/innobase/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2766,17 +2766,8 @@ innobase_start_or_create_for_mysql(void)
return(err);
}

/* create_log_files() can increase system lsn that is
why FIL_PAGE_FILE_FLUSH_LSN have to be updated */
flushed_lsn = log_get_lsn();

err = fil_write_flushed_lsn(flushed_lsn);

if (err == DB_SUCCESS) {
err = create_log_files_rename(
logfilename, dirnamelen,
flushed_lsn, logfile0);
}
err = create_log_files_rename(logfilename, dirnamelen,
log_get_lsn(), logfile0);

if (err != DB_SUCCESS) {
return(err);
Expand Down
10 changes: 0 additions & 10 deletions storage/xtradb/srv/srv0start.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2852,16 +2852,6 @@ innobase_start_or_create_for_mysql(void)
return(err);
}

/* create_log_files() can increase system lsn that is
why FIL_PAGE_FILE_FLUSH_LSN have to be updated */
flushed_lsn = log_get_lsn();

err = fil_write_flushed_lsn(flushed_lsn);

if (err != DB_SUCCESS) {
return(err);
}

err = create_log_files_rename(logfilename, dirnamelen,
log_get_lsn(), logfile0);

Expand Down

0 comments on commit 68890fe

Please sign in to comment.