summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.2 into 10.3bb-10.3-MDEV-12699Marko Mäkelä2019-04-1214-32/+473
|\
| * MDEV-12699 Improve crash recovery of corrupted data pagesMarko Mäkelä2019-04-1211-25/+467
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | InnoDB crash recovery used to read every data page for which redo log exists. This is unnecessary for those pages that are initialized by the redo log. If a newly created page is corrupted, recovery could unnecessarily fail. It would suffice to reinitialize the page based on the redo log records. To add insult to injury, InnoDB crash recovery could hang if it encountered a corrupted page. We will fix also that problem. InnoDB would normally refuse to start up if it encounters a corrupted page on recovery, but that can be overridden by setting innodb_force_recovery=1. Data pages are completely initialized by the records MLOG_INIT_FILE_PAGE2 and MLOG_ZIP_PAGE_COMPRESS. MariaDB 10.4 additionally recognizes MLOG_INIT_FREE_PAGE, which notifies that a page has been freed and its contents can be discarded (filled with zeroes). The record MLOG_INDEX_LOAD notifies that redo logging has been re-enabled after being disabled. We can avoid loading the page if all buffered redo log records predate the MLOG_INDEX_LOAD record. For the internal tables of FULLTEXT INDEX, no MLOG_INDEX_LOAD records were written before commit aa3f7a107ce3a9a7f80daf3cadd442a61c5493ab. Hence, we will skip these optimizations for tables whose name starts with FTS_. This is joint work with Thirunarayanan Balathandayuthapani. FIXME: For now, we disable the optimization for ROW_FORMAT=COMPRESSED tables because the redo logging for some operations seem to be broken. This will be fixed in MDEV-19241. fil_space_t::enable_lsn, file_name_t::enable_lsn: The LSN of the latest recovered MLOG_INDEX_LOAD record for a tablespace. mlog_init: Page initialization operations discovered during redo log scanning. FIXME: This really belongs in recv_sys->addr_hash, and should be removed in MDEV-19176. recv_addr_state: Add the new state RECV_WILL_NOT_READ to indicate that according to mlog_init, the page will be initialized based on redo log record contents. recv_add_to_hash_table(): Set the RECV_WILL_NOT_READ state if appropriate. For now, we do not treat MLOG_ZIP_PAGE_COMPRESS as page initialization. This works around bugs in the crash recovery of ROW_FORMAT=COMPRESSED tables. recv_mark_log_index_load(): Process a MLOG_INDEX_LOAD record by resetting the state to RECV_NOT_PROCESSED and by updating the fil_name_t::enable_lsn. recv_init_crash_recovery_spaces(): Copy fil_name_t::enable_lsn to fil_space_t::enable_lsn. recv_recover_page(): Add the parameter init_lsn, to ignore any log records that precede the page initialization. Add DBUG output about skipped operations. buf_page_create(): Initialize FIL_PAGE_LSN, so that recv_recover_page() will not wrongly skip applying the page-initialization record due to the field containing some newer LSN as a leftover from a different page. Do not invoke ibuf_merge_or_delete_for_page() during crash recovery. recv_apply_hashed_log_recs(): Remove some unnecessary lookups. Note if a corrupted page was found during recovery. After invoking buf_page_create(), do invoke ibuf_merge_or_delete_for_page() via mlog_init.ibuf_merge() in the last recovery batch. ibuf_merge_or_delete_for_page(): Relax a debug assertion. innobase_start_or_create_for_mysql(): Abort startup if a corrupted page was found during recovery. Corrupted pages will not be flagged if innodb_force_recovery is set. However, the recv_sys->found_corrupt_fs flag can be set regardless of innodb_force_recovery if file names are found to be incorrect (for example, multiple files with the same tablespace ID).
| * FSP_FLAGS_MEM_MASK: Remove traces of ATOMIC_WRITESMarko Mäkelä2019-04-101-5/+4
| |
| * Fix wsrep_thd_is_applier macro to point correct function name.Jan Lindström2019-04-101-1/+1
| |
| * cmake: pass CMAKE_BUILD_TYPE into src.rpmSergei Golubchik2019-04-091-1/+1
| | | | | | | | and don't pass BUILD_CONFIG twice, once is enough.
* | MDEV-19236 Improve error message for ↵Eugene Kosov2019-04-129-10/+10
| | | | | | | | | | | | ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE remove a sometimes misleading word INPLACE from error message
* | MDEV-19212: After-merge fix for sizeof(ulong)!=sizeof(ulint)Marko Mäkelä2019-04-082-7/+7
| |
* | MDEV-12266: Pass fil_space_t* to fseg_free_page()Marko Mäkelä2019-04-085-48/+51
| | | | | | | | | | fseg_free_page_func(): Avoid an unnecessary tablespace ID lookup. The callers should pass the tablespace that they already know.
* | MDEV-14192: Add debug assertionsVlad Lesin2019-04-083-18/+36
| |
* | Merge 10.2 into 10.3Marko Mäkelä2019-04-0819-308/+156
|\ \ | |/
| * Require --big-test for innodb.undo_truncate_recoverMarko Mäkelä2019-04-081-6/+2
| |
| * MDEV-19212: Replace macros with type-safe inline functionsMarko Mäkelä2019-04-085-28/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | The regression that was reported in MDEV-19212 occurred due to use of macros that did not ensure that the arguments have compatible types. ut_2pow_remainder(), ut_2pow_round(), ut_calc_align(): Define as inline function templates. UT_CALC_ALIGN(): Define as a macro, because this is used in compile_time_assert(). Only starting with C++11 (MariaDB 10.4) we could define the inline functions as constexpr.
| * MDEV-19212 4GB Limit on large_pages - integer overflowMarko Mäkelä2019-04-085-35/+16
| | | | | | | | | | | | | | | | | | os_mem_alloc_large(): Invoke the macro ut_2pow_round() with the correct argument type. innobase_large_page_size, innobase_use_large_pages, os_use_large_pages, os_large_page_size: Remove. Simply refer to opt_large_page_size, my_use_large_pages.
| * MDEV-14192 Mariabackup assertion failure: byte_offset % ↵Vlad Lesin2019-04-081-20/+11
| | | | | | | | | | | | | | | | | | | | OS_FILE_LOG_BLOCK_SIZE == 0 xtrabackup_backup_func(): If the log checkpoint header changed since we last read it, search for the most recent checkpoint again. Otherwise, we could corrupt the backup of the redo log, because the least significant bits of checkpoint_lsn_start would not match log_sys->log.lsn.
| * MDEV-8139: Clean up the freeing of B-tree pagesMarko Mäkelä2019-04-087-218/+98
| | | | | | | | | | | | | | | | | | | | btr_page_free(): Renamed from btr_page_free_low(). If scrubbing is enabled, zero out the page with proper redo logging. Only pass ahi=true to fseg_free_page() if the page is actually indexed. fil_space_t::modify_check(): Renamed from fsp_space_modify_check(). fsp_init_file_page(): Define inline.
| * cmake: force Boost dependency as neededSergei Golubchik2019-04-081-0/+5
| | | | | | | | because FindBoost.cmake won't do it
| * copy-paste error fixedSergei Golubchik2019-04-071-1/+1
| | | | | | | | thanks @FaramosCZ
| * cmake: don't use generated files to detect a submoduleSergei Golubchik2019-04-071-2/+2
| | | | | | | | | | | | Even if Makefile for some reason was checked in in a submodule, it is still a generated file, will be cleaned, won't be in a source package. One cannot jump to conclusions if it doesn't exist.
| * MDEV-18309: Remove unused codeMarko Mäkelä2019-04-074-26/+4
| |
* | Merge 10.2 into 10.3Marko Mäkelä2019-04-0729-434/+374
|\ \ | |/
| * MDEV-18309: InnoDB reports bogus errors about missing #sql-*.ibd on startupMarko Mäkelä2019-04-076-67/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a follow-up to MDEV-18733. As part of that fix, we made dict_check_sys_tables() skip tables that would be dropped by row_mysql_drop_garbage_tables(). DICT_ERR_IGNORE_DROP: A new mode where the file should not be attempted to be opened. dict_load_tablespace(): Do not try to load the tablespace if DICT_ERR_IGNORE_DROP has been specified. row_mysql_drop_garbage_tables(): Pass the DICT_ERR_IGNORE_DROP mode. fil_space_for_table_exists_in_mem(): Remove a parameter. The only caller that passed print_error_if_does_not_exist=true was row_drop_single_table_tablespace().
| * Re-record results for MTR_FEEDBACK_PLUGIN=1Marko Mäkelä2019-04-072-2/+2
| |
| * MDEV-12699 preparation: Clean up recv_sysMarko Mäkelä2019-04-064-222/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recv_sys data structures are accessed not only from the thread that executes InnoDB plugin initialization, but also from the InnoDB I/O threads, which can invoke recv_recover_page(). Assert that sufficient concurrency control is in place. Some code was accessing recv_sys data structures without holding recv_sys->mutex. recv_recover_page(bpage): Refactor the call from buf_page_io_complete() into a separate function that performs necessary steps. The main thread was unnecessarily releasing and reacquiring recv_sys->mutex. recv_recover_page(block,mtr,recv_addr): Pass more parameters from the caller. Avoid redundant lookups and computations. Eliminate some redundant variables. recv_get_fil_addr_struct(): Assert that recv_sys->mutex is being held. That was not always the case! recv_scan_log_recs(): Acquire recv_sys->mutex for the whole duration of the function. (While we are scanning and buffering redo log records, no pages can be read in.) recv_read_in_area(): Properly protect access with recv_sys->mutex. recv_apply_hashed_log_recs(): Check recv_addr->state only once, and continuously hold recv_sys->mutex. The mutex will be released and reacquired inside recv_recover_page() and recv_read_in_area(), allowing concurrent processing by buf_page_io_complete() in I/O threads.
| * MDEV-12699 preparation: Write MLOG_INDEX_LOAD for FTS_ tablesMarko Mäkelä2019-04-064-17/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The record MLOG_INDEX_LOAD is supposed to be written to indicate that some page modifications bypassed redo logging, and that redo logging is now re-enabled. It was not written for fulltext indexes during ALTER TABLE. row_merge_write_redo(): Declare globally. Assert that the index is neither a spatial nor fulltext index. recv_mlog_index_load(): Observe a MLOG_INDEX_LOAD operation. recv_parse_log_recs(): Handle MLOG_INDEX_LOAD also in multi-record mini-transactions. Because of this omission, we should keep writing MLOG_INDEX_LOAD in single-record mini-transactions, because older versions of Mariabackup would fail. row_fts_merge_insert(): Write MLOG_INDEX_LOAD for the auxiliary tables of fulltext indexes.
| * MDEV-12699 preparation: Initialize the entire page on MLOG_ZIP_PAGE_COMPRESSMarko Mäkelä2019-04-063-27/+30
| | | | | | | | | | | | The record MLOG_ZIP_PAGE_COMPRESS is similar to MLOG_INIT_FILE_PAGE2 that it contains all the information needed to initialize the page. Like for the other record, do initialize the entire page on recovery.
| * buf_page_get_gen(): Allow BUF_GET_IF_IN_POOL with a dummy page_sizeMarko Mäkelä2019-04-063-29/+20
| | | | | | | | | | | | | | The page_size argument to buf_page_get_gen() only matters when the page is going to be loaded into the buffer pool. Allow callers to pass a dummy parameter when using BUF_GET_IF_IN_POOL (which would return NULL if the block is not in the buffer pool).
| * Fix a crash in CHECK TABLE for corrupted encrypted root pageMarko Mäkelä2019-04-061-7/+2
| | | | | | | | | | | | | | | | btr_root_get(): Ignore the root->page.encrypted flag. The purpose of this flag is questionable since commit 8c43f963882a9d5ac4e4289c8dd3dbcaeb40a0ce. btr_validate_index(): Avoid crash if btr_root_get() returns NULL.
| * MDEV-15528 preparation: Do not modify a freed pageMarko Mäkelä2019-04-061-34/+17
| | | | | | | | | | | | btr_free_root(): Add the parameter bool invalidate. btr_free_root_invalidate(): Remove.
| * Clean up the parsing of MLOG_INIT_FILE_PAGE2Marko Mäkelä2019-04-063-46/+13
| | | | | | | | | | | | | | fsp_apply_init_file_page(): Renamed from fsp_init_file_page_low(). fsp_parse_init_file_page(): Remove. The redo log record has no parameters.
| * recv_recovery_is_on(): Add UNIV_UNLIKELYMarko Mäkelä2019-04-066-31/+19
| | | | | | | | | | | | Normally, InnoDB is not in the process of executing crash recovery. Provide a hint to the compiler that the recovery-related code paths are rarely executed.
| * Re-record plugins.feedback_plugin_loadMarko Mäkelä2019-04-061-1/+1
| |
| * MDEV-19112 WITH clause does not work with information_schema as default databaseIgor Babaev2019-04-055-14/+52
| | | | | | | | | | | | With INFORMATION_SCHEMA set as the default database the check that a table referred in the processed query is defined in INORMATION_SCHEMA must be postponed until all CTE names can be identified.
* | Merge 10.2 into 10.3Marko Mäkelä2019-04-0443-212/+192
|\ \ | |/
| * Merge 10.1 into 10.2Marko Mäkelä2019-04-0411-5/+34
| |\
| | * index_merge_innodb did sometimes give wrong resultsMonty2019-04-048-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | Fixed by adding more rows to a table Other things: - Speed up index_merge tests 20% by adding begin/commit around loops that generated rows.
| | * Fix clang -Wunused-private-fieldMarko Mäkelä2019-04-033-5/+1
| | |
| * | Do not pass table_name_t to printf-like functionsMarko Mäkelä2019-04-046-12/+12
| | |
| * | MDEV-18836: Adjust a suppressionMarko Mäkelä2019-04-031-1/+1
| | | | | | | | | | | | | | | Normally, InnoDB will create temporary table names of the form #sql-ibNNNN, and with innodb_safe_truncate=OFF, #sql-ibNNNN-MMMM.
| * | Fix the non-debug buildMarko Mäkelä2019-04-031-2/+2
| | |
| * | Merge 10.1 into 10.2Marko Mäkelä2019-04-034-4/+0
| |\ \ | | |/
| | * Remove unused declarationsMarko Mäkelä2019-04-039-63/+1
| | |
| | * Fix more -Wnonnull-compareMarko Mäkelä2019-04-032-2/+0
| | | | | | | | | | | | For some reason, GCC 8 did not issue warnings for all such comparisons.
| * | MDEV-18733 MariaDB slow start after crash recoveryMarko Mäkelä2019-04-0320-181/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If InnoDB crash recovery was needed, the InnoDB function srv_start() would invoke extra validation, reading something from every InnoDB data file. This should be unnecessary now that MDEV-14717 made RENAME operations crash-safe inside InnoDB (which can be disabled in MariaDB 10.2 by setting innodb_safe_truncate=OFF). dict_check_sys_tables(): Skip tables that would be dropped by row_mysql_drop_garbage_tables(). Perform extra validation only if innodb_safe_truncate=OFF, innodb_force_recovery=0 and crash recovery was needed. dict_load_table_one(): Validate the root page of the table. In this way, we can deny access to corrupted or mismatching tables not only after crash recovery, but also after a clean shutdown.
| * | Remove a useless CHECK TABLE printout for debug buildsMarko Mäkelä2019-04-031-7/+0
| | |
| * | Clean up table_name_tMarko Mäkelä2019-04-037-81/+46
| | | | | | | | | | | | | | | | | | | | | row_is_mysql_tmp_table_name(): Replaced with dict_table_t::is_temporary_name() and table_name_t::is_temporary(). table_name_t: Add constructors.
* | | Fix the non-debug buildMarko Mäkelä2019-04-031-2/+2
| | |
* | | Merge 10.2 into 10.3Marko Mäkelä2019-04-0325-170/+78
|\ \ \ | |/ /
| * | MDEV-11487: Remove dict_table_get_n_sys_cols()Marko Mäkelä2019-04-036-23/+13
| | | | | | | | | | | | | | | | | | In MariaDB, InnoDB tables will always contain DATA_N_SYS_COLS = 3 columns, 2 or 3 of which are present in the clustered index. We remove the predicate that was added in MySQL 5.7 as part of WL#7682.
| * | Merge 10.1 into 10.2Marko Mäkelä2019-04-0340-334/+102
| |\ \ | | |/
| | * Fix -Wnonnull-compareMarko Mäkelä2019-04-0334-321/+48
| | | | | | | | | | | | | | | InnoDB and XtraDB had redundant assertions for checking that function parameters that were declared as nonnull were not NULL.