Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.20
-
None
-
10.2.4-5
Description
Prepare of partial backup (with --tables option) sporadically fails with following error :
InnoDB: Error: tablespace size stored in header is 4864 pages, but
InnoDB: the sum of data file sizes is only 768 pages
InnoDB: Cannot start InnoDB. The tail of the system tablespace is
InnoDB: missing.
Attached are:
test_partial_uncommitted.sh - test which reliably demonstrates the problem in my environment
test_partial_uncommitted.log - corresponding log
my.cnf - config used
partial_uncommitted.test 'identical' mtr test, which DOES NOT demonstrate the problem (for unknown reasons (generated xtrabackup_info and backup-my.cnf are identical to .sh test).
Interesting observation is that all tables are backed up - this should be another bug eventually if not fixed as part of this.
Attachments
Issue Links
- causes
-
MDEV-12027 posix_fallocate returned OS error 201.
-
- Closed
-
-
MDEV-12075 innodb_use_fallocate does not work in MariaDB Server 10.1.21
-
- Closed
-
-
MDEV-22501 Various issues when using --innodb-data-file-size-debug=-1 | SIGABRT in fil_mutex_enter_and_prepare_for_io
-
- Closed
-
- relates to
-
MDEV-11690 Remove UNIV_HOTBACKUP
-
- Closed
-
-
MDEV-11915 Detect InnoDB system tablespace size mismatch early
-
- Closed
-
-
MDEV-12022 InnoDB wrongly ignores the end of an .ibd file
-
- Closed
-
-
MDEV-13822 Mariabackup --prepare --incremental sets file size incorrectly
-
- Closed
-
-
MDEV-14082 Enforcing innodb_open_files leads to fil_system->mutex problem
-
- Closed
-
-
MDEV-18194 Incremental prepare tries to access page which is out of tablespace bounds.
-
- Closed
-
-
MDEV-30069 InnoDB: Trying to write ... bytes at ... outside the bounds of the file ...
-
- Closed
-
-
MDEV-11968 With innodb_page_size=8K crash with 'Error 17' after "Tried to read 65536 bytes at offset 0. Was only able to read 49152."
-
- Closed
-
-
MDEV-12893 innodb.log_data_file_size failed in buildbot with InnoDB: Database page corruption
-
- Closed
-
-
MDEV-14447 mariabackup --incremental --prepare fails to extend last file when applying ibdata1.delta
-
- Closed
-
-
MDEV-23190 Assertion `id.page_no() < space.size' during recovery
-
- Closed
-
-
MDEV-26068 Server crashes when innodb-data-file-size-debug set to 1
-
- Closed
-
The remaining problem was solved by removing some inappropriate rounding of the InnoDB system tablespace size:
diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc
index 8b04b51ce0b..34fb1f87bdf 100644
--- a/storage/xtradb/srv/srv0start.cc
+++ b/storage/xtradb/srv/srv0start.cc
@@ -192,9 +192,6 @@ static const ulint SRV_UNDO_TABLESPACE_SIZE_IN_PAGES =
#define SRV_N_PENDING_IOS_PER_THREAD OS_AIO_N_PENDING_IOS_PER_THREAD
#define SRV_MAX_N_PENDING_SYNC_IOS 100
-/** The round off to MB is similar as done in srv_parse_megabytes() */
-#define CALC_NUMBER_OF_PAGES(size) ((size) / (1024 * 1024)) * \
- ((1024 * 1024) / (UNIV_PAGE_SIZE))
#ifdef UNIV_PFS_THREAD
/* Keys to register InnoDB threads with performance schema */
UNIV_INTERN mysql_pfs_key_t io_handler_thread_key;
@@ -1029,15 +1026,12 @@ open_or_create_data_files(
size = os_file_get_size(files[i]);
ut_a(size != (os_offset_t) -1);
- /* Under some error conditions like disk full
- narios or file size reaching filesystem
- limit the data file could contain an incomplete
- extent at the end. When we extend a data file
- and if some failure happens, then also the data
- file could contain an incomplete extent. So we
- need to round the size downward to a megabyte.*/
+ /* If InnoDB encountered an error or was killed
+ while extending the data file, the last page
+ could be incomplete. */
- rounded_size_pages = (ulint) CALC_NUMBER_OF_PAGES(size);
+ rounded_size_pages = static_cast<ulint>(
+ size >> UNIV_PAGE_SIZE_SHIFT);
if (i == srv_n_data_files - 1