467
|
|
Fix handling of compressed tablespaces, created between the last full or incremental and the next incremental backup.
Bugs fixed: bug 1049174 (Redundant zip_size handling at delta application time), bug 1044398 (Handling of compressed tablespaces with compressed page size == server page size broken), bug 1043762 (Incremental backups may take up to 5x more space after the fix for bug #1022562).
In order not to include the first 64KB of a tablespace unconditionally in every delta (bug 1043762), we need to be able to create a tablespace on disk without relying on the presence of the first pages of a newly-created tablespace in the delta. These pages, in the absence of any later writes to them, get a modification LSN of 0, causing them to be omitted from the delta.
Thus we create new tablespaces from scratch by a new function xb_delta_create_space_file() that is similar to fil_create_new_single_table_tablespace() in InnoDB. For this function to work, it needs a tablespace flags value, and a default value of 0 (which assumes a regular uncompressed tablespace) will cause asserts in trying to apply log records to it later, if the tablespace is actually compressed and its header page was not overwritten by the delta due to reasons above. Thus, we need the actual flags value.
For this purpose we extend the incremental backup delta metadata with a new field zip_size. On backup preperation the presence of this flag is optional, to keep the ability to restore from the old backups and because its value is required only in the case describe above (a new compressed tablespace created between the backups, no log records touching its 1st page).
Always pass zero to fil_space_create() instead of the tablespace flags in xb_delta_open_matching_space(). Push the flags calculation between fil_space_create() and xb_delta_create_space_file(). Calculate these flags for all XtraBackup flavours by conditionally defining the required constants, to minimize the conditionally-compiled code. If there was no zip_size in the metadata, assume flags to be zero.
Revert the changes in xtrabackup_copy_datafile() made for bug 1022562, that is, do not store the first 64KB of every tablespace unconditionally.
In xtrabackup_apply_delta(), remove the assumption that zip_size is equal to page_size whenever page_size < UNIV_PAGE_SIZE, fixing bug 10443398.
No testsuite changes, as this is non-functional case. The regular incremental compressed backups are tested by the xb_incremental_compressed test, an the corner case of a new compressed tablespace that does not have its 1st page in the delta is tested by bug1028949 test.
|
Laurynas Biveinis |
11 years ago
|
|
|
466
|
|
|
Stewart Smith |
11 years ago
|
|
|
465
|
|
|
Alexey Kopytov |
11 years ago
|
|
|
464
|
|
|
Ignacio Nin |
11 years ago
|
|
|
463
|
|
|
Stewart Smith |
11 years ago
|
|
|
462
|
|
|
Stewart Smith |
11 years ago
|
|
|
461
|
|
|
Stewart Smith |
11 years ago
|
|
|
460
|
|
|
Stewart Smith |
11 years ago
|
|
|
459
|
|
|
Stewart Smith |
11 years ago
|
|
|
458
|
|
|
Stewart Smith |
11 years ago
|
|
|
457
|
|
|
Stewart Smith |
11 years ago
|
|
|
456
|
|
|
Stewart Smith |
11 years ago
|
|
|
455
|
|
|
Stewart Smith |
11 years ago
|
|
|
454
|
|
|
Stewart Smith |
11 years ago
|
|
|
453
|
|
|
Stewart Smith |
11 years ago
|
|
|
452
|
|
|
Stewart Smith |
11 years ago
|
|
|
451
|
|
|
Stewart Smith |
11 years ago
|
|
|
450
|
|
|
Stewart Smith |
11 years ago
|
|
|
449
|
|
|
Stewart Smith |
11 years ago
|
|
|
448
|
|
|
Stewart Smith |
11 years ago
|
|
|