summaryrefslogtreecommitdiff
path: root/storage/innobase/fil/fil0fil.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-01-21 16:16:32 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-01-21 16:16:32 +0200
commitb07920b634f455c39e3650c6163bec2a8ce0ffe0 (patch)
treeef8b5220184d337c21d52b52fa9e2afb6283ba16 /storage/innobase/fil/fil0fil.cc
parent88d9fbb484c7de98c2f86aebe5ae87fbaa01f0fb (diff)
downloadmariadb-git-b07920b634f455c39e3650c6163bec2a8ce0ffe0.tar.gz
MDEV-27199: Remove FIL_PAGE_FILE_FLUSH_LSNbb-10.8-MDEV-14425
The only purpose of the field FIL_PAGE_FILE_FLUSH_LSN was to store the log sequence number for a new ib_logfile0 when the InnoDB redo log was missing at startup. Because FIL_PAGE_FILE_FLUSH_LSN no longer serves any purpose, we will stop updating it. The writes of that field were inherently risky, because they were not covered by neither the redo log nor the doublewrite buffer. Warning: After MDEV-14425 and before this change, users could perform a clean shutdown of the server, replace the ib_logfile0 with a 0-length file, and expect a valid log file to be created on the next server startup. After this change, if the FIL_PAGE_FILE_FLUSH_LSN had ever been updated in the past, the server would still create a log file in such a scenario, but possibly with an incorrect (too small) LSN. Users should not manipulate log files directly!
Diffstat (limited to 'storage/innobase/fil/fil0fil.cc')
-rw-r--r--storage/innobase/fil/fil0fil.cc42
1 files changed, 0 insertions, 42 deletions
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index 5a592c3a768..cd2c867de60 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -1382,48 +1382,6 @@ void fil_set_max_space_id_if_bigger(uint32_t max_id)
mysql_mutex_unlock(&fil_system.mutex);
}
-/** Write the flushed LSN to the page header of the first page in the
-system tablespace.
-@param[in] lsn flushed LSN
-@return DB_SUCCESS or error number */
-dberr_t
-fil_write_flushed_lsn(
- lsn_t lsn)
-{
- byte* buf;
- ut_ad(!srv_read_only_mode);
-
- if (!fil_system.sys_space->acquire()) {
- return DB_ERROR;
- }
-
- buf = static_cast<byte*>(aligned_malloc(srv_page_size, srv_page_size));
-
- auto fio = fil_system.sys_space->io(IORequestRead, 0, srv_page_size,
- buf);
-
- if (fio.err == DB_SUCCESS) {
- mach_write_to_8(buf + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION,
- lsn);
-
- uint32_t fsp_flags = mach_read_from_4(
- buf + FSP_HEADER_OFFSET + FSP_SPACE_FLAGS);
-
- if (fil_space_t::full_crc32(fsp_flags)) {
- buf_flush_assign_full_crc32_checksum(buf);
- }
-
- fio = fil_system.sys_space->io(IORequestWrite,
- 0, srv_page_size, buf);
- fil_flush_file_spaces();
- } else {
- fil_system.sys_space->release();
- }
-
- aligned_free(buf);
- return fio.err;
-}
-
/** Acquire a tablespace reference.
@param id tablespace identifier
@return tablespace