WL#7990: Repurpose FIL_PAGE_FLUSH_LSN

Status: Complete   —   Priority: Medium

The field FIL_PAGE_FLUSH_LSN is consulted during InnoDB startup.

At startup, InnoDB reads the FIL_PAGE_FLUSH_LSN from the first page of each file
in the InnoDB system tablespace. If there are multiple files, the minimum and
maximum LSN can differ. These numbers are passed to InnoDB startup.

Having the number in other files than the first file of the InnoDB system
tablespace is not providing much additional value. It is conflicting with other
use of the field, such as on InnoDB R-tree index pages.

The FIL_PAGE_FLUSH_LSN was also being written to InnoDB undo tablespace
files, even though the fields are not going to be consulted on crash recovery.

This worklog will stop writing FIL_PAGE_FLUSH_LSN to other files than the first
file of the InnoDB system tablespace (page number 0:0).
FR1: The FIL_PAGE_FILE_FLUSH_LSN field will only be updated on the first page of
the system tablespace, no shutdown or when resizing the redo log. This write
is bypassing the redo log and the buffer pool.

FR2: The FIL_PAGE_FILE_FLUSH_LSN will not be updated on other pages.

FR3: Other code may use the bytes reserved for FIL_PAGE_FILE_FLUSH_LSN
on pages other than page 0 of the system tablespace. Example: The InnoDB
R-tree indexes use it for storing the split sequence number.
fil_write_flushed_lsn(): A new function, merged from
fil_write_lsn_and_arch_no_to_file() and
fil_write_flushed_lsn_to_data_files().
Only write to the first page of the system tablespace (page 0:0),
and invoke fil_flush_file_spaces(FIL_TYPE_TABLESPACE) afterwards.

fil_open_single_table_tablespace(): Remove output of LSN, because it
was only valid for the system tablespace and the undo tablespaces, not
user tablespaces.

Datafile::m_flushed_lsn: Remove.

Datafile::validate_first_page(),
SysTablespace::read_lsn_and_check_flags():
Add an output parameter for flushed_lsn.

SysTablespace::read_lsn_and_check_flags(): Only read the first file.

SysTablespace::open_or_create(): Replace the output parameters
min_lsn,max_lsn with flush_lsn.

Tablespace::m_min_flushed_lsn: Remove.
Tablespace::m_max_flushed_lsn: Remove.

recv_recovery_from_checkpoint_start(): Replace the two parameters
min_flushed_lsn, max_flushed_lsn with one: flush_lsn.

innobase_start_or_create_for_mysql(): Remove a message that would
detect FIL_PAGE_FILE_FLUSH_LSN mismatch between multiple files of the
system tablespace.