summaryrefslogtreecommitdiff
path: root/mysql-test/suite/mariabackup
Commit message (Collapse)AuthorAgeFilesLines
* Fix tests for PLUGIN_PARTITION=NOMarko Mäkelä2021-10-271-0/+1
|
* MDEV-25884 Tests use environment $USER variable without quotesElena Stepanova2021-06-102-2/+2
|
* MDEV-24197: Add "innodb_force_recovery" for "mariabackup --prepare"Srinidhi Kaushik2021-04-012-0/+164
| | | | | | | | | | | | | | | | | | | During the prepare phase of restoring backups, "mariabackup" does not seem to allow (or recognize) the option "innodb_force_recovery" for the embedded InnoDB server instance that it starts. If page corruption observed during page recovery, the prepare step fails. While this is indeed the correct behavior ideally, allowing this option to be set in case of emergencies might be useful when the current backup is the only copy available. Some error messages during "--prepare" suggest to set "innodb_force_recovery" to 1: [ERROR] InnoDB: Set innodb_force_recovery=1 to ignore corruption. For backwards compatibility, "mariabackup --innobackupex --apply-log" should also have this option. Signed-off-by: Srinidhi Kaushik <shrinidhi.kaushik@gmail.com>
* MDEV-25221 Do not remove source file, if copy_file() fails in mariabackup ↵Vladislav Vaintroub2021-03-312-0/+34
| | | | | | --move-back Remove an incompletely copied destination file.
* MDEV-22929 fixup. Print "completed OK!" if page corruption and ↵Vladislav Vaintroub2021-03-052-10/+15
| | | | | | | --log-innodb-page-corruption Since we do not stop at corrupted page error, there is no reason to log a backup error.
* MDEV-22929 MariaBackup option to report and/or continue when corruption is ↵Vlad Lesin2020-12-015-1/+715
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encountered The new option --log-innodb-page-corruption is introduced. When this option is set, backup is not interrupted if innodb corrupted page is detected. Instead it logs all found corrupted pages in innodb_corrupted_pages file in backup directory and finishes with error. For incremental backup corrupted pages are also copied to .delta file, because we can't do LSN check for such pages during backup, innodb_corrupted_pages will also be created in incremental backup directory. During --prepare, corrupted pages list is read from the file just after redo log is applied, and each page from the list is checked if it is allocated in it's tablespace or not. If it is not allocated, then it is zeroed out, flushed to the tablespace and removed from the list. If all pages are removed from the list, then --prepare is finished successfully and innodb_corrupted_pages file is removed from backup directory. Otherwise --prepare is finished with error message and innodb_corrupted_pages contains the list of the pages, which are detected as corrupted during backup, and are allocated in their tablespaces, what means backup directory contains corrupted innodb pages, and backup can not be considered as consistent. For incremental --prepare corrupted pages from .delta files are applied to the base backup, innodb_corrupted_pages is read from both base in incremental directories, and the same action is proceded for corrupted pages list as for full --prepare. innodb_corrupted_pages file is modified or removed only in base directory. If DDL happens during backup, it is also processed at the end of backup to have correct tablespace names in innodb_corrupted_pages.
* MDEV-24026: InnoDB: Failing assertion: os_total_large_mem_allocated >= size ↵Vlad Lesin2020-10-292-1/+6
| | | | | | | | upon incremental backup mariabackup deallocated uninitialized write_filt_ctxt.u.wf_incremental_ctxt in xtrabackup_copy_datafile() when some table should be skipped due to parsed DDL redo log record.
* MDEV-23720 Change innodb_log_optimize_ddl=OFF by defaultMarko Mäkelä2020-10-252-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | MariaDB 10.2.2 inherited from MySQL 5.7 a perceived optimization of ALTER TABLE, which skips the writing of redo log records. In MDEV-16809 we introduced a parameter that allows the redo log to be written, so that Mariabackup would not be impacted, but we kept the MySQL 5.7 behaviour enabled by default (innodb_log_optimize_ddl=ON). As noted in MDEV-19747 (Deprecate and ignore innodb_log_optimize_ddl, implemented in MariaDB 10.5.1), omitting the redo log writes can actually reduce performance, because we will have to wait for the data pages to be written out. When the redo log file is configured to be large enough, it actually can be much faster to write the redo log and avoid the extra page flushing. When the redo log is omitted (innodb_log_optimize_ddl=ON), also Mariabackup may have to perform a lot of extra work, to re-copy the entire data file if it is possible that any log was omitted during the backup. Starting with MariaDB 10.5.1, the parameter innodb_log_optimize_ddl is deprecated and ignored. We hereby deprecate (but will not ignore) the parameter in earlier versions as well.
* MDEV-20755 InnoDB: Database page corruption on disk or a failed file read of ↵Vlad Lesin2020-10-233-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tablespace upon prepare of mariabackup incremental backup The problem: When incremental backup is taken, delta files are created for innodb tables which are marked as new tables during innodb ddl tracking. When such tablespace is tried to be opened during prepare in xb_delta_open_matching_space(), it is "created", i.e. xb_space_create_file() is invoked, instead of opening, even if a tablespace with the same name exists in the base backup directory. xb_space_create_file() writes page 0 header the tablespace. This header does not contain crypt data, as mariabackup does not have any information about crypt data in delta file metadata for tablespaces. After delta file is applied, recovery process is started. As the sequence of recovery for different pages is not defined, there can be the situation when crypt data redo log event is executed after some other page is read for recovery. When some page is read for recovery, it's decrypted using crypt data stored in tablespace header in page 0, if there is no crypt data, the page is not decryped and does not pass corruption test. This causes error for incremental backup --prepare for encrypted tablespaces. The error is not stable because crypt data redo log event updates crypt data on page 0, and recovery for different pages can be executed in undefined order. The fix: When delta file is created, the corresponding write filter copies only the pages which LSN is greater then some incremental LSN. When new file is created during incremental backup, the LSN of all it's pages must be greater then incremental LSN, so there is no need to create delta for such table, we can just copy it completely. The fix is to copy the whole file which was tracked during incremental backup with innodb ddl tracker, and copy it to base directory during --prepare instead of delta applying. There is also DBUG_EXECUTE_IF() in innodb code to avoid writing redo log record for crypt data updating on page 0 to make the test case stable. Note: The issue is not reproducible in 10.5 as optimized DDL's are deprecated in 10.5. But the fix is still useful because it allows to decrease data copy size during backup, as delta file contains some extra info. The test case should be removed for 10.5 as it will always pass.
* MDEV-23711 make mariabackup innodb redo log read error message more clearVlad Lesin2020-09-213-0/+99
| | | | | | | | | | | | | | | | | | | | | log_group_read_log_seg() returns error when: 1) Calculated log block number does not correspond to read log block number. This can be caused by: a) Garbage or an incompletely written log block. We can exclude this case by checking log block checksum if it's enabled(see innodb-log-checksums, encrypted log block contains checksum always). b) The log block is overwritten. In this case checksum will be correct and read log block number will be greater then requested one. 2) When log block length is wrong. In this case recv_sys->found_corrupt_log is set. 3) When redo log block checksum is wrong. In this case innodb code writes messages to error log with the following prefix: "Invalid log block checksum." The fix processes all the cases above.
* MDEV-19264 Better support MariaDB GTID for Mariabackup's --slave-info optionVlad Lesin2020-09-142-0/+121
| | | | | | Parse SHOW SLAVE STATUS output for the "Using_Gtid" column. If the value is "No", then old log file and position is backed up, otherwise gtid_slave_pos is backed up.
* Merge 10.1 into 10.2Marko Mäkelä2020-07-142-0/+12
|\
| * MDEV-15662 mariabackup.huge_lsn fails sporadically with "log sequence ↵Thirunarayanan Balathandayuthapani2020-07-142-0/+12
| | | | | | | | | | | | | | | | | | number is in the future" - Problem is that test case creates iblogfile* files. So existing ibdata pages could point to future LSN. Fix is that taking the backup of data before iblogfile* creation and apply it before exiting the test case.
* | MDEV-21222 mariabackup.incremental_backup failed with memory allocation failureSergei Golubchik2020-07-011-0/+5
| | | | | | | | | | | | | | mariabackup tries to allocate a buffer of page_size*page_size/4 size. for 64k page it means 1Gb, which doesn't work very well on 32-bit builders. Skip the 64k page test on 32bit.
* | MDEV-20230: mariabackup --ftwrl-wait-timeout never times out on explicitbb-10.2-MDEV-20230-ftwrl-wait-timeoutVlad Lesin2020-04-272-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | lock --ftwrl-wait-timeout does not finish mariabackup execution when acquired backup lock can't be grabbed for the certain amount of time, it just waits for a long queries finishing before acquiring the lock to avoid unnecessary locking. This commit extends --ftwrl-wait-timeout so, that mariabackup execution is finished if it waits for backup lock during certain amount of time.
* | MDEV-19347: Mariabackup does not honor ignore_db_dirs from serverbb-10.2-MDEV-19347-ignore_db_dirsVlad Lesin2020-04-213-0/+23
| | | | | | | | | | | | | | | | | | | | | | config. The solution is to read the system variable value on startup and to fill databases_exclude_hash. xb_load_list_string() became non-static and was reformatted. The system variable value is read and processed in get_mysql_vars(), which was also reformatted.
* | MDEV-21168: Active XA transactions stop slave from working after backupVlad Lesin2020-04-072-0/+122
| | | | | | | | | | | | | | | | | | was restored. Optionally rollback prepared XA's on "mariabackup --prepare". The fix MUST NOT be ported on 10.5+, as MDEV-742 fix solves the issue for slaves.
* | MDEV-21255: Deadlock of parallel slave and mariabackup (with failed logVlad Lesin2019-12-123-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | copy thread) mariabackup hangs waiting until innodb redo log thread read log till certain LSN, and it waits under FTWRL. If there is redo log read error in the thread, it is finished, and main thread knows nothing about it, what leads to hanging. As it hangs under FTWRL, slave threads on server side can be blocked due to MDL lock conflict. The fix is to finish mariabackup with error message on innodb redo log read failure.
* | MDEV-18310: Aria engine: Undo phase failed with "Got error 121 whenVlad Lesin2019-11-292-4/+63
| | | | | | | | | | | | | | | | executing undo undo_key_delete" upon startup on datadir restored from incremental backup aria_log* files were not copied on --prepare --incremental-dir step from incremental to destination backup directory.
* | MDEV-20703: mariabackup creates binlog files in server binlog directory on ↵Vlad Lesin2019-10-011-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --prepare --export step When "--export" mariabackup option is used, mariabackup starts the server in bootstrap mode to generate *.cfg files for the certain innodb tables. The started instance of the server reads options from the file, pointed out in "--defaults-file" mariabackup option. If the server uses the same config file as mariabackup, and binlog is switched on in that config file, then "mariabackup --prepare --export" will create binary log files in the server's binary log directory, what can cause issues. The fix is to add "--skip-log-bin" in mysld options when the server is started to generate *.cfg files.
* | MDEV-18438 Don't stream xtrabackup_info of extra-lsndirSimon Lipp2019-09-194-0/+21
| |
* | MDEV-20421: big_innodb_log reliably fails on buildbot WindowsVlad Lesin2019-09-062-12/+1
| | | | | | | | | | | | | | | | | | | | The test fails because it reuses mysqltest perl code to copy directory tree, and this code contains Windows-specific piece which outputs some diagnostic information. The patch introduces new parameter for that Windows-specific perl code to have the ability to suppress diagnostic output on the corresponding mysqltest perl module initialization.
* | MDEV-20421 : Disable the test until fixedVladislav Vaintroub2019-08-261-0/+12
| |
* | MDEV-20060: Failing assertion: srv_log_file_size <= 512ULL << 30 while ↵Vlad Lesin2019-08-072-0/+117
| | | | | | | | | | | | | | | | | | | | | | preparing backup The general reason why innodb redo log file is limited by 512G is that log_block_convert_lsn_to_no() returns value limited by 1G. But there is no need to have unique log block numbers in log group. The fix removes 512G limit and limits log group size by (uint32_t maximum value) * (minimum page size), which, in turns, can be removed if fil_io() is no longer used for innodb redo log io.
* | MDEV-18565: Galera mtr-suite fails if galera library is not installedJulius Goryavsky2019-07-172-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, running mtr with an incorrect (for example, new or obsolete) version of wsrep_provider (for example, with the 26 version of libgalera_smm.so) leads to the failure of tests in several suites with vague error diagnostics. As for the galera_3nodes suite, the mtr also does not effectively check all the prerequisites after merge with MDEV-18426 fixes. For example, tests that using mariabackup do not check for presence of ss and socat/nc. This is due to improper handling of relative paths in mtr scripts. In addition, some tests in different suites can be run without setting the environment variables such as MTR_GALERA_TFMT, XBSTREAM, and so on. To eliminate all these issues, this patch makes the following changes: 1. Added auxiliary wsrep_mtr_check utility (which located in the mysql-test/lib/My/SafeProcess subdirectory), which compares the versions of the wsrep API that used by the server and by the wsrep provider library, and it does this comparison safely, without accessing the API if the versions do not match. 2. All checks related to the presence of mariabackup and utilities that necessary for its operation transferred from the local directories of different mtr suites (from the suite.pm files) to the main suite.pm file. This not only reduces the amount of code and eliminates duplication of identical code fragments, but also avoids problems due to the inability of mtr to consider relative paths to include files when checking skip combinations. 3. Setting the values of auxiliary environment variables that are necessary for Galera, SST scripts and mariabackup (to work properly) is moved to the main mysql-test-run.pl script, so as not to duplicate this code in different suites, and to avoid partial corrections of the same errors for different suites (while other suites remain uncorrected). 4. Fixed duplication of the have_file_key_management.inc and have_filekeymanagement.inc files between different suites, these checks are also transferred to the top level. 5. Added garbd presence check and garbd path variable. https://jira.mariadb.org/browse/MDEV-18565
* | MDEV-19886 InnoDB returns misleading ER_NO_SUCH_TABLE_IN_ENGINEMarko Mäkelä2019-06-272-3/+2
| | | | | | | | | | A fix in MySQL 5.7.6 was not completely merged to MariaDB: Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND"
* | Speed up buildbot by requiring --big-test for some slow testsMarko Mäkelä2019-05-291-0/+2
| |
* | MDEV-18544 "missing required privilege PROCESS on *.*" using mariabackup for SSTVladislav Vaintroub2019-05-022-1/+3
| | | | | | | | | | | | | | If required privilege is missing, dump the output from "SHOW GRANTS" into mariabackup log. This will help troubleshooting, and make the bug reproducible.
* | Merge 10.1 into 10.2Marko Mäkelä2019-03-262-4/+25
|\ \ | |/
| * MDEV-12711 mariabackup --backup is refused for multi-file system tablespaceMarko Mäkelä2019-03-262-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | Before MDEV-12113 (MariaDB Server 10.1.25), on shutdown InnoDB would write the current LSN to the first page of each file of the system tablespace. This is incompatible with MariaDB's InnoDB table encryption, because encryption repurposed the field for an encryption key ID and checksum. buf_page_is_corrupted(): For the InnoDB system tablespace, skip FIL_PAGE_FILE_FLUSH_LSN when checking if a page is all zero, because the first page of each file in the system tablespace can contain nonzero bytes in the field.
* | Merge 10.1 into 10.2Marko Mäkelä2019-03-082-0/+45
|\ \ | |/
| * MDEV-18855 Mariabackup should fetch innodb_compression_level from running serverThirunarayanan Balathandayuthapani2019-03-082-0/+45
| | | | | | | | | | | | | | - Fetch innodb_compression_level from the running server.Add the value of innodb_compression_level in backup-my.cnf file during backup phase. So that prepare can use the innodb_compression_level variable from backup-my.cnf
* | MDEV-18204 Fix rocksdb incremental backupVladislav Vaintroub2019-02-183-0/+58
| | | | | | | | | | Fix incremental prepare to copy #rocksdb subdirectory from the incremental dir.
* | MDEV-18194 Incremental prepare tries to access page which is out of ↵Thirunarayanan Balathandayuthapani2019-02-012-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tablespace bounds Problem: ======= Mariabackup incremental prepare creates new tablespace when it encounter new tablespace. It sets the intial size as FIL_IBD_FILE_INITIAL_SIZE (4). But while applying redo log, it tries to access 5th page and then it leads to out of tablespace error. Fix: === While parsing the redo log record, track FSP_SIZE in recv_spaces for the respective space id. Assign the recv_size for the tablespace when it is loaded. Extend the tablespace depends on recv_size while applying the redo log record.
* | MDEV-18415 mariabackup.mdev-14447 test case fails with Table 'test.t' ↵Thirunarayanan Balathandayuthapani2019-02-012-2/+13
| | | | | | | | | | | | | | doesn't exist in engine - Added retry logic if validation of first page fails with checksum mismatch.
* | MDEV-18201 : mariabackup- fix processing of rename/create sequence in prepareVladislav Vaintroub2019-01-102-0/+16
| | | | | | | | | | | | | | | | | | Fix one more bug in "DDL redo" phase in prepare If table was renamed, and then new table was created with the old name, prepare can be confused, and .ibd can end up with wrong name. Fix the order of how DDL fixup is applied , once again - ".new" files should be processed after renames.
* | MDEV-18185 - mariabackup - fix specific case of table rename handing in prepare.Vladislav Vaintroub2019-01-092-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | If, during backup 1) Innodb table is dropped (after being copied to backup) and then 2) Before backup finished, another Innodb table is renamed, and new name is the name of the dropped table in 1) then, --prepare fails with assertion, as DDL fixup code in prepare did not handle this specific case. The fix is to process drops before renames, in prepare DDL-"redo" phase.
* | Merge 10.1 into 10.2Marko Mäkelä2018-12-291-0/+4
|\ \ | |/
| * MDEV-18105 Mariabackup fails to copy encrypted InnoDB system tablespace if ↵Marko Mäkelä2018-12-291-0/+4
| | | | | | | | | | | | | | | | | | | | LSN>4G This is a regression caused by commit 8c43f963882a9d5ac4e4289c8dd3dbcaeb40a0ce that was part of the MDEV-12112 fixes. page_is_corrupted(): Never interpret page_no=0 as encrypted.
* | Add forgotten .opt file.mariadb-10.2.20Vladislav Vaintroub2018-12-211-0/+1
| |
* | Add test for partial backup for partitioned table.Vladislav Vaintroub2018-12-212-0/+75
| |
* | Merge 10.1 into 10.2Marko Mäkelä2018-12-216-7/+13
|\ \ | |/
| * Cleanup recent mariabackup validation patches.Vladislav Vaintroub2018-12-201-1/+7
| | | | | | | | | | | | | | | | | | | | | | - Refactor code to isolate page validation in page_is_corrupted() function. - Introduce --extended-validation parameter(default OFF) for mariabackup --backup to enable decryption of encrypted uncompressed pages during backup. - mariabackup would still always check checksum on encrypted data, it is needed to detect partially written pages.
* | Merge 10.1 into 10.2Marko Mäkelä2018-12-192-11/+24
|\ \ | |/
| * MDEV-18025: Improve test case and consistency checksMarko Mäkelä2018-12-192-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | Write a test case that computes valid crc32 checksums for an encrypted page, but zeroes out the payload area, so that the checksum after decryption fails. xb_fil_cur_read(): Validate the page number before trying any checksum calculation or decrypting or decompression. Also, skip zero-filled pages. For page_compressed pages, ensure that the FIL_PAGE_TYPE was changed. Also, reject FIL_PAGE_PAGE_COMPRESSED_ENCRYPTED if no decryption was attempted.
* | Merge 10.1 into 10.2Marko Mäkelä2018-12-185-0/+116
|\ \ | |/
| * MDEV-18025 Mariabackup fails to detect corrupted page_compressed=1 tablesThirunarayanan Balathandayuthapani2018-12-185-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: ======= Mariabackup seems to fail to verify the pages of compressed tables. The reason is that both fil_space_verify_crypt_checksum() and buf_page_is_corrupted() will skip the validation for compressed pages. Fix: ==== Mariabackup should call fil_page_decompress() for compressed and encrypted compressed page. After that, call buf_page_is_corrupted() to check the page corruption.
* | MDEV-14975 mariabackup starts with unprivileged user.Vladislav Vaintroub2018-12-142-0/+35
| | | | | | | | | | | | | | | | | | | | ported privilege checking from xtrabackup. Now, mariabackup would terminate early if either RELOAD or PROCESS privilege is not held, not at the very end of backup The behavior can be disabled with nre setting --check-privileges=0. Also , --no-lock does not need all of these privileges, since it skips FTWRL and SHOW ENGINE STATUS INNODB.
* | Merge 10.1 into 10.2Marko Mäkelä2018-12-143-0/+63
|\ \ | |/
| * MDEV-12112 corruption in encrypted table may be overlookedMarko Mäkelä2018-12-143-0/+63
| | | | | | | | | | | | | | | | | | | | | | After validating the post-encryption checksum on an encrypted page, Mariabackup should decrypt the page and validate the pre-encryption checksum as well. This should reduce the probability of accepting invalid pages as valid ones. This is a backport and refactoring of a patch that was originally written by Thirunarayanan Balathandayuthapani for the 10.2 branch.