summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-21766 - Forbid XID with empty 'gtrid'bb-10.5-svoj-MDEV-21766Sergey Vojtovich2020-02-284-3/+61
| | | | | | | | | XA specification doesn't permit empty gtrid. It is now enforced by this patch. This solution was agreed in favour of fixing InnoDB, which doesn't expect empty XID since early 10.5. Also fixed wrong assertion (and added a test cases) that didn't permit 64 bytes gtrid + 64 bytes bqual.
* MDEV-21838: Add information about packed addon fields in ANALYZE FORMAT=JSON10.5-mdev21784-reg1-baseVarun Gupta2020-02-287-1/+129
| | | | | It is useful to know whether sorting uses addon fields[packed|unpacked] or ROWID. Provide this information in ANALYZE FORMAT=JSON output.
* Fix GCC -Wsign-compareMarko Mäkelä2020-02-271-1/+2
|
* Fix GCC -WparenthesesMarko Mäkelä2020-02-271-1/+1
|
* MDEV-21724: Optimize page_cur_insert_low() redo loggingMarko Mäkelä2020-02-275-220/+1059
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inserting a record into an index page involves updating multiple fields in the page header as well as updating the next-record links and potentially updating fields related to the sparse page directory. Let us cover the insert operations by higher-level log records, to avoid 'redundant' logging about the writes. The code for applying the high-level log records will check the consistency of the page thoroughly, to avoid crashes during recovery. We will refuse to replay the inserts if any inconsistency is detected. With innodb_force_recovery=1, recovery will continue, but the affected pages may be more inconsistent if some changes were omitted. mrec_ext_t: Introduce the EXTENDED record subtypes INSERT_HEAP_REDUNDANT, INSERT_REUSE_REDUNDANT, INSERT_HEAP_DYNAMIC, INSERT_REUSE_DYNAMIC. The record will explicitly identify the page type and whether the space will be allocated from PAGE_HEAP_TOP or reused from the PAGE_FREE list. It will also tell how many bytes to copy from the preceding record header and payload, and how to initialize the rest of the record header and payload. mtr_t::page_insert(): Write the high-level log records. log_phys_t::apply(): Parse the high-level log records. page_apply_insert_redundant(), page_apply_insert_dynamic(): Apply the high-level log records. page_dir_split_slot(): Introduce a variant that does not write log nor deal with ROW_FORMAT=COMPRESSED pages. page_mem_alloc_heap(): Remove the mtr_t parameter page_cur_insert_rec_low(): Write log only via mtr_t::page_insert().
* MDEV-12353 Cleanup: Remove page_rec_get_base_extra_size()Marko Mäkelä2020-02-272-24/+0
| | | | | The function page_rec_get_base_extra_size() became dead code in commit 08ba388713946c03aa591899cd3a446a6202f882.
* MDEV-12353: Improve page_cur_delete_rec() recoveryMarko Mäkelä2020-02-273-13/+24
| | | | | | | | | This is a follow-up to commit 572d20757be38157fa2309c35efdec19e68087f1 where we introduced the EXTENDED log record subtypes DELETE_ROW_FORMAT_REDUNDANT and DELETE_ROW_FORMAT_DYNAMIC. log_phys_t::apply(): If corruption was noticed, stop applying the log unless innodb_force_recovery is set.
* MDEV-12353: Make UNDO_APPEND more robustMarko Mäkelä2020-02-273-11/+23
| | | | | | | | | | | | | | | This is a follow-up to commit 84e3f9ce84c3e7fce70142cff4bea1c8b916810b that introduced the EXTENDED log record of UNDO_APPEND subtype. mtr_t::undo_append(): Accurately enforce the mtr_buf_t::MAX_DATA_SIZE limit. Also, replace mtr_buf_t::push() with simpler code, to append 1 byte to the log. log_phys_t::undo_append(): Return whether the page was found to be in an inconsistent state. log_phys_t::apply(): If corruption was noticed, stop applying log unless innodb_force_recovery is set.
* cleanup trailing wsSergey Vojtovich2020-02-273-19/+19
|
* MDEV-10569: Add RELEASE_ALL_LOCKS function. Implementing the SQLDaniel-Solo2020-02-275-29/+237
| | | | function to release all named locks
* Revert "MDEV-17554 Auto-create new partition for system versioned tables ↵Sergei Golubchik2020-02-2714-596/+79
| | | | | | | with history partitioned by INTERVAL/LIMIT" This reverts commit 9894751a2a61ef952ac6ac556fd683e53fc150e2. This reverts commit f707c83fff4fa3f5291684e6226542fdb75bbdeb.
* Compilation fixAleksey Midenkov2020-02-251-0/+1
|
* MDEV-17554 Auto-create new partition for system versioned tables with ↵Aleksey Midenkov2020-02-2514-79/+595
| | | | | | | | | | | | | | | | | | | | | | | | | | | | history partitioned by INTERVAL/LIMIT When there are E empty partitions left, auto-create N new empty partitions for SYSTEM_TIME partitioning rotated by INTERVAL/LIMIT and marked by AUTO_INCREMENT keyword. Syntax change: AUTO_INCREMENT keyword (or shorter AUTO may be used instead) after LIMIT/INTERVAL clause. CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME LIMIT 100000 AUTO_INCREMENT; CREATE OR REPLACE TABLE t (x INT) WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 WEEK AUTO_INCREMENT; The current revision implements hard-coded values of 1 for E and N. As well as auto-creation threshold MinInterval = 1 hour, MinLimit = 1000. The name for newly added partition will be first chosen as "pX", where X is partition number and "p" is hard-coded name prefix. If this name is already occupied, the X will be incremented until the resulting name will be free to use. ALTER TABLE ADD PARTITION is now always fast. If there some history partition overflow occurs manual ALTER TABLE REBUILD PARTITION is needed.
* Review comments: Refactoring the duplicatesNamrata Bhave2020-02-241-167/+44
| | | Have separated out the common dependencies on top.
* Adding s390x to Travis buildsNamrata Bhave2020-02-241-56/+294
|
* try to fix sysvars_innodb,32bit testEugene Kosov2020-02-241-2/+2
|
* MDEV-21749: page_cur_insert_rec_low(): Assertion rdm - rd + bd <= insert_buf ↵Marko Mäkelä2020-02-242-29/+35
| | | | | | | | | | | | | | | | | | + rec_size failed. This bug was introduced in commit 7ae21b18a6b73bbc3bf1ff448faf60c29ac1d386 (the main commit of MDEV-12353). page_cur_insert_rec_low(): Before entering the comparison loop, make sure that the range does not exceed c_end already at the start of the loop. The loop is only comparing for pointer equality, and that condition cdm == c_end would never hold if the end was already exceeded in the beginning. Also, skip the comparison altogether if we could find at most 2 equal bytes. PageBulk::insertPage(): Apply a similar change. It seems that this code was correct, because the loop checks for cdm < c_end.
* MDEV-12353: Fix cmake -DWITH_INNODB_EXTRA_DEBUGMarko Mäkelä2020-02-241-2/+2
| | | | | The compilation was accidentally broken in commit 22f649a67a26d98ed46b57ebe42799f4717e27bf.
* MDEV-12353: Reduce log volume of page_cur_delete_rec()Marko Mäkelä2020-02-227-174/+504
| | | | | | | | | | | | | | | | | | | | | | | | | mrec_ext_t: Introduce DELETE_ROW_FORMAT_REDUNDANT, DELETE_ROW_FORMAT_DYNAMIC. mtr_t::page_delete(): Write DELETE_ROW_FORMAT_REDUNDANT or DELETE_ROW_FORMAT_DYNAMIC log records. We log the byte offset of the preceding record, so that on recovery we can easily find everything to update. For DELETE_ROW_FORMAT_DYNAMIC, we must also write the header and data size of the record. We will retain the physical logging for ROW_FORMAT=COMPRESSED pages. page_zip_dir_balance_slot(): Renamed from page_dir_balance_slot(), and specialized for ROW_FORMAT=COMPRESSED only. page_rec_set_n_owned(), page_dir_slot_set_n_owned(), page_dir_balance_slot(): New variants that do not write any log. page_mem_free(): Take data_size, extra_size as parameters. Always zerofill the record payload. page_cur_delete_rec(): For other than ROW_FORMAT=COMPRESSED, only write log by mtr_t::page_delete().
* Disable galera_as_slave_gtid_replicate_do_db_cc because it crashes.Jan Lindström2020-02-213-45/+45
|
* MDEV-21601 : Cleanup Galera disabled testsJan Lindström2020-02-216-122/+0
| | | | | | * Remove those tests that will not be supported on that release. * Make sure that correct tests are disabled and have MDEVs * Sort test names
* Fix Galera test galera_as_slave_ctas.Jan Lindström2020-02-212-30/+32
|
* MDEV-21420 : Galera test failure on galera.mysql-wsrep#33Jan Lindström2020-02-214-7/+418
| | | | Add more tests and move SST restore to correct place.
* MDEV-21514 : Galera test failure on galera.galera_wan_restart_sst on AzureJan Lindström2020-02-213-29/+20
| | | | Remove sleeps and unnecessary waits.
* MDEV-21140 Make galera_recovery.sh work with fs.protected_regular = 1 (#1417)Alexander E. Patrakov2020-02-210-0/+0
| | | | | The log file is opened as root since commit bb7a70c, so there is no need to chown it.
* MDEV-18180 : Galera test failure on galera.galera_concurrent_ctasJan Lindström2020-02-212-19/+18
| | | | Test changes only.
* MDEV-21517 : Galera test galera_sr.GCF-561 failure: Result length mismatchJan Lindström2020-02-212-5/+10
| | | | Add wait conditions.
* MDEV-21421 : Galera test sporadic failure on ↵Jan Lindström2020-02-214-61/+61
| | | | | | | galera.galera_as_slave_gtid_myisam: Result length mismatch In Galera 4 nodes 1 and 2 are galera nodes and node_3 should be non galera.
* MDEV-21601 : Cleanup Galera disabled testsJan Lindström2020-02-2121-1440/+3
| | | | | | | | * Remove those tests that will not be supported on that release. * Make sure that correct tests are disabled and have MDEVs * Sort test names This should not be merged upwards.
* Cleanup: Remove dict_ind_redundantMarko Mäkelä2020-02-207-62/+16
| | | | | | | | | | | | There is no reason for the dummy index object dict_ind_redundant to exist any more. It was only being passed to btr_create(). btr_create(): If !index, assume that a ROW_FORMAT=REDUNDANT table is being created. We could pass ibuf.index, dict_sys.sys_tables->indexes.start and so on, if those objects had been initialized before the function btr_create() is called.
* MDEV-21774 Innodb, Windows : restore file sharing logic in InnodbEugene Kosov2020-02-204-34/+44
| | | | | | | | | | | | | | | | | | recv_sys_t opened redo log files along with log_sys_t. That's why I removed file sharing logic from InnoDB in 9ef2d29ff44de2013c95666a011b993e5c2e5674 But it was actually used to ensure that only one MariaDB instance will touch the same InnoDB files. os0file.cc: revert some changes done previously mapped_file_t::map(): now has arguments read_only, nvme file_io::open(): now has argument read_only class file_os_io: make final log_file_t::open(): now has argument read_only
* MDEV-12353: Reduce log volume by an UNDO_APPEND recordMarko Mäkelä2020-02-195-57/+125
| | | | | | | | | | | | | | | | | | | | | | | | We introduce an EXTENDED log record for appending an undo log record to an undo log page. This is equivalent to the MLOG_UNDO_INSERT record that was removed in commit f802c989ec7410c6f54a77ac41b0566a178cdf62, only using more compact encoding. mtr_t::log_write(): Fix a bug that affects longer log record writes in the !same_page && !have_offset case. Similar code is already implemented for the have_offset code path. The bug was unobservable before we started to write longer EXTENDED records. All !have_offset records (FREE_PAGE, INIT_PAGE, EXTENDED) that were written so far are short, and we never write RESERVED or OPTION records. mtr_t::undo_append(): Write an UNDO_APPEND record. log_phys_t::undo_append(): Apply an UNDO_APPEND record. trx_undo_page_set_next_prev_and_add(), trx_undo_page_report_modify(), trx_undo_page_report_rename(): Invoke mtr_t::undo_append() instead of emitting WRITE records.
* MDEV-12353: Reduce log volume by an UNDO_INIT recordMarko Mäkelä2020-02-196-39/+95
| | | | | | | | | | | | | | | We introduce an EXTENDED log record for initializing an undo log page. The size of the record will be 2 bytes plus the optional page identifier. The entire undo page will be initialized, except the space that is already reserved for TRX_UNDO_SEG_HDR in trx_undo_seg_create(). mtr_t::undo_create(): Write the UNDO_INIT record. trx_undo_page_init(): Initialize the undo page corresponding to the UNDO_INIT record. Unlike the former MLOG_UNDO_INIT record, we will initialize almost the entire page, including initializing the TRX_UNDO_PAGE_NODE to an empty list node, so that the subsequent call to flst_init() will avoid writing log for the undo page.
* revert accidental libmariadb changeEugene Kosov2020-02-191-0/+0
|
* fix libpmem InnoDB linkingEugene Kosov2020-02-192-5/+2
|
* remove unused functionEugene Kosov2020-02-191-21/+0
|
* MDEV-14425 deprecate and ignore innodb_log_files_in_groupEugene Kosov2020-02-1933-775/+637
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now there can be only one log file instead of several which logically work as a single file. Possible names of redo log files: ib_logfile0, ib_logfile101 (for just created one) innodb_log_fiels_in_group: value of this variable is not used by InnoDB. Possible values are still 1..100, to not break upgrade LOG_FILE_NAME: add constant of value "ib_logfile0" LOG_FILE_NAME_PREFIX: add constant of value "ib_logfile" get_log_file_path(): convenience function that returns full path of a redo log file SRV_N_LOG_FILES_MAX: removed srv_n_log_files: we can't remove this for compatibility reasons, but now server doesn't use this variable log_sys_t::file::fd: now just one, not std::vector log_sys_t::log_capacity: removed word 'group' find_and_check_log_file(): part of logic from huge srv_start() moved here recv_sys_t::files: file descriptors of redo log files. There can be several of those in case we're upgrading from older MariaDB version. recv_sys_t::remove_extra_log_files: whether to remove ib_logfile{1,2,3...} after successfull upgrade. recv_sys_t::read(): open if needed and read from one of several log files recv_sys_t::files_size(): open if needed and return files count redo_file_sizes_are_correct(): check that redo log files sizes are equal. Just to log an error for a user. Corresponding check was moved from srv0start.cc namespace deprecated: put all deprecated variables here to prevent usage of it by us, developers
* Update wsrep-lib submodule.Jan Lindström2020-02-191-0/+0
|
* MDEV-12353 Cleanup: Rename INIT_INDEX_PAGE to EXTENDEDMarko Mäkelä2020-02-183-25/+38
| | | | | | | | | | | | | We plan use the redo log record main type code 0x20 for InnoDB specific index page operations. mrec_type_t: Rename INIT_INDEX_PAGE to EXTENDED. mrec_ext_t: The EXTENDED subtypes. This is a non-functional change: the redo log record encoding that was introduced in commit 7ae21b18a6b73bbc3bf1ff448faf60c29ac1d386 is not affected.
* Reduce innodb_log_buffer_sizeMarko Mäkelä2020-02-182-2/+1
|
* MDEV-21725 Optimize btr_page_reorganize_low() redo loggingMarko Mäkelä2020-02-182-140/+216
| | | | | | | btr_page_reorganize_low(): Log only the changed data in the page. TODO: Do not copy the entire changed payload to the redo log. Emit a combination of MEMMOVE and WRITE records to reduce the log volume.
* MDEV-21744 Assertion `!rec_offs_nth_sql_null(offsets, n)' failedMarko Mäkelä2020-02-175-5/+62
| | | | | | | | | | | | | commit 08ba388713946c03aa591899cd3a446a6202f882 of MDEV-12353 introduced an incorrect assumption, which was documented by the failing assertion. After instant ADD COLUMN, we can have a null (and in-place) UPDATE of NULL to NULL. No data needs to be written for such updates. For ROW_FORMAT=REDUNDANT, we reserve space for the NULL values, and to be compatible with existing behaviour, we will zerofill the unused data bytes when updating to NULL value.
* MDEV-21174: Correct a debug assertion failureMarko Mäkelä2020-02-171-2/+2
| | | | | | | | | trx_purge_free_segment(): In some cases (observed when running the test innodb_zip.wl5522_debug_zip), there is no change to the TRX_UNDO_NEEDS_PURGE field. Add mtr_t::OPT to disable a debug check. The bogus debug check was introduced in commit 56f6dab1d0e5a464ea49c1e5efb0032a0f5cea3e.
* MDEV-12353: Reformat page_delete_rec_list_end()Marko Mäkelä2020-02-171-193/+189
| | | | | | | | | | | We add FIXME comments and some sketch code for the following cases: It is possible to write considerably less log for ROW_FORMAT=COMPRESSED pages. For now, we will delete the records one by one. It is also possible to treat 'deleting the last records' as a special case that would involve shrinking PAGE_HEAP_TOP. That should reduce the need of reorganizing pages.
* MDEV-12353: Optimize page_cur_delete_rec() logging furtherMarko Mäkelä2020-02-171-7/+26
| | | | | | | page_mem_free(): When deleting the very last record of the page, even if the record did not fully utilize all bytes in a former PAGE_FREE record, truncate the PAGE_HEAP_TOP and reduce PAGE_GARBAGE by the saved amount.
* Clarify, spelling for wsrep_strict_ddl description (#1447)Ian Gilfillan2020-02-172-2/+2
|
* MDEV-12353: Write less log for BLOB pagesMarko Mäkelä2020-02-176-136/+56
| | | | | | | | | | | | | | | | | | | fsp_page_create(): Always initialize the page. The logic to avoid initialization was made redundant and should have been removed in mysql/mysql-server@ce0a1e85e24e48b8171f767b44330da635a6ea0a (MySQL 5.7.5). btr_store_big_rec_extern_fields(): Remove the redundant initialization of FIL_PAGE_PREV and FIL_PAGE_NEXT. An INIT_PAGE record will have been written already. Only write the ROW_FORMAT=COMPRESSED page payload from FIL_PAGE_DATA onwards. We were unnecessarily writing from FIL_PAGE_TYPE onwards, which caused an assertion failure on recovery: recv_sys_t::alloc(size_t): Assertion 'len <= srv_page_size' failed when running the following tests: ./mtr --no-reorder innodb_zip.blob,4k innodb_zip.bug56680,4k
* MDEV-12353: Fix a Galera assertion failureMarko Mäkelä2020-02-161-3/+7
| | | | | | | trx_rseg_write_wsrep_checkpoint(): Add missing mtr_t::OPT, and avoid an unnecessary call to mtr_t::memset(). This addresses a debug assertion failure in wsrep_info.plugin.
* MDEV-12353: Optimize page_delete_rec_list_end() loggingMarko Mäkelä2020-02-161-51/+52
|
* MDEV-12353: Remove bogus conditionsMarko Mäkelä2020-02-162-16/+3
| | | | | | | | | page_update_max_trx_id(), page_delete_rec_list_end(): Remove conditions on recv_recovery_is_on(). These conditions should have been removed in or before commit f8a9f906679e1d1ab026c245f7d24c652050d8b3 (removing the support for crash-upgrade). The physical redo log based recovery will not call such high-level code.