summaryrefslogtreecommitdiff
path: root/storage/innobase/btr
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-12353: Replace MLOG_*LIST_*_DELETE and MLOG_*REC_DELETEMarko Mäkelä2020-02-132-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer write the following redo log records: MLOG_COMP_LIST_END_DELETE, MLOG_LIST_END_DELETE, MLOG_COMP_LIST_START_DELETE, MLOG_LIST_START_DELETE, MLOG_REC_DELETE,MLOG_COMP_REC_DELETE. Each individual deleted record will be logged separately using physical log records. page_dir_slot_set_n_owned(), page_zip_rec_set_owned(), page_zip_dir_delete(), page_zip_clear_rec(): Add the parameter mtr, and write redo log. page_dir_slot_set_rec(): Remove. Replaced with lower-level operations that write redo log when necessary. page_rec_set_n_owned(): Replaces rec_set_n_owned_old(), rec_set_n_owned_new(). rec_set_heap_no(): Replaces rec_set_heap_no_old(), rec_set_heap_no_new(). page_mem_free(), page_dir_split_slot(), page_dir_balance_slot(): Add the parameter mtr. page_dir_set_n_slots(): Merge with the caller page_dir_split_slot(). page_dir_slot_set_rec(): Merge with the callers page_dir_split_slot() and page_dir_balance_slot(). page_cur_insert_rec_low(), page_cur_insert_rec_zip(): Suppress the logging of lower-level operations. page_cur_delete_rec_write_log(): Remove. page_cur_delete_rec(): Do not tolerate mtr=NULL. rec_convert_dtuple_to_rec_old(), rec_convert_dtuple_to_rec_comp(): Replace rec_set_heap_no_old() and rec_set_heap_no_new() with direct access that does not involve redo logging. mtr_t::memcpy(): Do allow non-redo-logged writes to uncompressed pages of ROW_FORMAT=COMPRESSED pages. buf_page_io_complete(): Evict the uncompressed page of a ROW_FORMAT=COMPRESSED page after recovery. Because we no longer write logical log records for deleting index records, but instead write physical records that may refer directly to the compressed page frame of a ROW_FORMAT=COMPRESSED page, and because on recovery we will only apply the changes to the ROW_FORMAT=COMPRESSED page, the uncompressed page frame can be stale until page_zip_decompress() is executed. recv_parse_or_apply_log_rec_body(): After applying MLOG_ZIP_WRITE_STRING, ensure that the FIL_PAGE_TYPE of the uncompressed page matches the compressed page, because buf_flush_init_for_writing() assumes that field to be valid. mlog_init_t::mark_ibuf_exist(): Invoke page_zip_decompress(), because the uncompressed page after buf_page_create() is not necessarily up to date. buf_LRU_block_remove_hashed(): Bypass a page_zip_validate() check during redo log apply. recv_apply_hashed_log_recs(): Invoke mlog_init.mark_ibuf_exist() also for the last batch, to ensure that page_zip_decompress() will be called for freshly initialized pages.
* MDEV-12353: Replace MLOG_PAGE_CREATE_RTREE, MLOG_PAGE_COMP_CREATE_RTREEMarko Mäkelä2020-02-133-25/+53
| | | | | | | | | | | | page_create(): Create normal B-tree pages. Callers that create R-tree pages will set FIL_PAGE_TYPE and reset the split sequence number afterwards. The creation of ROW_FORMAT=COMPRESSED pages is unaffected; they will be logged as compressed page images. page_create_low(): Take const buf_block_t* as a parameter. Let the callers invoke buf_block_modify_clock_inc().
* MDEV-12353: Replace DELETE_MARK redo log records with MLOG_WRITE_STRINGMarko Mäkelä2020-02-131-168/+183
| | | | | | | | | | | | | | | | btr_cur_upd_rec_sys(): Replaces row_upd_rec_sys_fields() and implements redo logging. row_upd_rec_sys_fields_in_recovery(): Remove, and merge to the only remaining caller btr_cur_parse_update_in_place(). btr_cur_del_mark_set_clust_rec_log(), btr_cur_del_mark_set_sec_rec_log(), btr_cur_set_deleted_flag_for_ibuf(): Remove, and replace with btr_rec_set_deleted<bool>(). page_zip_rec_set_deleted(): Add the parameter mtr, and write a MLOG_ZIP_WRITE_STRING record to the log.
* MDEV-12353: Replace MLOG_PAGE_REORGANIZE, MLOG_COMP_PAGE_REORGANIZEMarko Mäkelä2020-02-133-66/+48
| | | | | | | | | Log page reorganize as a series of insert operations. This will make the redo log volume proportional to the page payload size. btr_page_reorganize_low(): Add template <bool recovery=false> btr_page_reorganize_block(): Remove the parameter 'bool recovery'
* MDEV-12353: Replace MLOG_*_END_COPY_CREATEDMarko Mäkelä2020-02-131-111/+140
| | | | | | | | | | | | | | | | Instead of writing the high-level redo log records MLOG_LIST_END_COPY_CREATED, MLOG_COMP_LIST_END_COPY_CREATED write log for each individual insert of a record. page_copy_rec_list_end_to_created_page(): Remove. This will improve the fill factor of some pages. Adjust some tests accordingly. PageBulk::init(), PageBulk::finish(): Avoid setting bogus limits to PAGE_HEAP_TOP and PAGE_N_DIR_SLOTS. Avoid accessor functions that would enforce these limits before the correct ones are set at the end of PageBulk::finish().
* MDEV-12353: Exclusively use page_zip_reorganize() for ROW_FORMAT=COMPRESSEDMarko Mäkelä2020-02-132-95/+35
| | | | | | | | | | | page_zip_reorganize(): Restore the page on failure. In callers, omit now-redundant calls to page_zip_decompress(). btr_page_reorganize_low(): Define in static scope only, and remove the z_level parameter. Assert that ROW_FORMAT is not COMPRESSED. btr_page_reorganize_block(), btr_page_reorganize(): Invoke page_zip_reorganize() for ROW_FORMAT=COMPRESSED.
* MDEV-12353: Deprecate and ignore innodb_log_compressed_pagesMarko Mäkelä2020-02-131-20/+4
| | | | | | page_zip_compress_write_log_no_data(): Remove. We no longer write the MLOG_ZIP_PAGE_COMPRESS_NO_DATA record. Instead, we will write MLOG_ZIP_PAGE_COMPRESS records.
* MDEV-15058: Deprecate and ignore innodb_buffer_pool_instancesMarko Mäkelä2020-02-123-28/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our benchmarking efforts indicate that the reasons for splitting the buf_pool in commit c18084f71b02ea707c6461353e6cfc15d7553bc6 have mostly gone away, possibly as a result of mysql/mysql-server@ce6109ebfdedfdf185e391a0c97dc6d33867ed78 or similar work. Only in one write-heavy benchmark where the working set size is ten times the buffer pool size, the buf_pool->mutex would be less contended with 4 buffer pool instances than with 1 instance, in buf_page_io_complete(). That contention could be alleviated further by making more use of std::atomic and by splitting buf_pool_t::mutex further (MDEV-15053). We will deprecate and ignore the following parameters: innodb_buffer_pool_instances innodb_page_cleaners There will be only one buffer pool and one page cleaner task. In a number of INFORMATION_SCHEMA views, columns that indicated the buffer pool instance will be removed: information_schema.innodb_buffer_page.pool_id information_schema.innodb_buffer_page_lru.pool_id information_schema.innodb_buffer_pool_stats.pool_id information_schema.innodb_cmpmem.buffer_pool_instance information_schema.innodb_cmpmem_reset.buffer_pool_instance
* MDEV-19747: Deprecate and ignore innodb_log_optimize_ddlMarko Mäkelä2020-02-113-37/+11
| | | | | | | | | | | | | | | | | | | | | During native table rebuild or index creation, InnoDB used to skip redo logging and write MLOG_INDEX_LOAD records to inform crash recovery and Mariabackup of the gaps in redo log. This is fragile and prohibits some optimizations, such as skipping the doublewrite buffer for newly (re)initialized pages (MDEV-19738). row_merge_write_redo(): Remove. We do not write MLOG_INDEX_LOAD records any more. Instead, we write full redo log. FlushObserver: Remove. fseg_free_page_func(): Remove the parameter log. Redo logging cannot be disabled. fil_space_t::redo_skipped_count: Remove. We cannot remove buf_block_t::skip_flush_check, because PageBulk will temporarily generate invalid B-tree pages in the buffer pool.
* fix aligned memcpy()-like functions usageEugene Kosov2020-01-231-6/+4
| | | | | | | | | I found that memcpy_aligned was used incorrectly at redo log and decided to put assertions in aligned functions. And found even more incorrect cases. Given the amount discovered of bugs, I left assertions to prevent future bugs. my_assume_aligned(): instead of MY_ASSUME_ALIGNED macro
* Merge 10.4 into 10.5Marko Mäkelä2020-01-201-136/+66
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-01-201-137/+67
| |\ | | | | | | | | | | | | The MDEV-17062 fix in commit c4195305b2a8431f39a4c75cc1c66ba43685f7a0 was omitted.
| | * Merge 10.2 into 10.3Marko Mäkelä2020-01-181-127/+66
| | |\
| | | * MDEV-21512 InnoDB may hang due to SPATIAL INDEXMarko Mäkelä2020-01-171-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MySQL 5.7.29 includes the following fix: Bug #30287668 INNODB: A LONG SEMAPHORE WAIT mysql/mysql-server@5cdbb22b51cf2b35dbdf5666a251ffbec2f84dec There is no test case. It seems that the problem could occur when a spatial index is large and peculiar enough so that multiple R-tree leaf pages will have the exactly same maximum bounding rectangle (MBR). The commit message suggests that the hang can occur when R-tree non-leaf pages are being merged, which should only be possible during transaction rollback or the purge of transaction history, when the R-tree index is at least 2 levels high and very many records are being deleted. The message says that a comparison result that two spatial index node pointer records are equal will cause an infinite loop in rtr_page_copy_rec_list_end_no_locks(). Hence, we must include the child page number in the comparison to be consistent with mysql/mysql-server@2e11fe0e152e34d73579e1a9ec19aedc3f6010f6. We fix this bug in a simpler way, involving fewer code changes. cmp_rec_rec(): Renamed from cmp_rec_rec_with_match(). Assert that rec2 always resides in an index page. Treat non-leaf spatial index pages specially.
| | | * MDEV-21511: Remove unnecessary codeMarko Mäkelä2020-01-171-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we will be invoking dtuple_get_n_ext() instead of letting btr_push_update_extern_fields() update an already calculated value, it is unnecessary to calculate the n_ext upfront. row_rec_to_index_entry(), row_rec_to_index_entry_low(): Remove the output parameter n_ext.
| | | * MDEV-21511 Wrong estimate of affected BLOB columns in updateMarko Mäkelä2020-01-171-81/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During update, rollback, or MVCC read, we may miscalculate the number of off-page columns, and thus the size of the clustered index record. The function btr_push_update_extern_fields() is mostly redundant, because the off-page columns would also be moved by row_upd_index_replace_new_col_val(), which is invoked via row_upd_index_replace_new_col_vals(). btr_push_update_extern_fields(): Remove. This is based on mysql/mysql-server@1fa475b85d24de4b9ce2958c0eed738c221fc82c which refines a fix for a recovery bug fix mysql/mysql-server@ce0a1e85e24e48b8171f767b44330da635a6ea0a in MySQL 5.7.5. No test case was provided by Oracle. Some of the changed code is being covered by the existing test innodb.blob-crash.
| | | * MDEV-21509 Possible hang during purge of history, or rollbackMarko Mäkelä2020-01-171-30/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WL#6326 in MariaDB 10.2.2 introduced a potential hang on purge or rollback when an index tree is being shrunk by multiple levels. This fix is based on mysql/mysql-server@f2c58526300c0d84837effa26d37cbd5d2694967 with the main difference that our version of the test case uses DEBUG_SYNC instrumentation on ROLLBACK, not on purge. btr_cur_will_modify_tree(): Simplify the check further. This is the actual bug fix. row_undo_mod_remove_clust_low(), row_undo_mod_clust(): Add DEBUG_SYNC instrumentation for the test case.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-01-031-26/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.3' into 10.4Oleksandr Byelkin2020-01-031-27/+0
| |\ \ \ | | |/ /
| | * | Merge branch '10.2' into 10.3Oleksandr Byelkin2020-01-031-27/+0
| | |\ \ | | | |/
| | | * Post-fix for MDEV-12253: Remove redundant log writesMarko Mäkelä2019-12-301-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 8 bytes at FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION will be overwritten at page flush, in buf_page_encrypt_before_write(), ever since commit 765a43605a42c069ede604826ede2d93d72c4fdd (MariaDB 10.1.23, 10.2.6, 10.3.1). btr_store_big_rec_extern_fields(): Remove useless writes to the page header (and to the redo log) for ROW_FORMAT=COMPRESSED BLOB pages.
| | * | MDEV-21405 Assertion failed on instant ADD COLUMNMarko Mäkelä2019-12-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_cur_pessimistic_insert(): Relax a too strict debug assertion that would fail when the function is invoked by btr_cur_pessimistic_update() during innobase_add_instant_try(), that is, when updating the hidden metadata record during a subsequent ADD COLUMN operation involves splitting the leftmost clustered index leaf page. This is a partial backport of 301bd62b2536f85a8ce418dcd5e705796d8c5763 from 10.4.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-12-167-101/+108
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-12-137-100/+107
| |\ \ \ | | |/ / | | | | | | | | | | | | We disable the MDEV-21189 test galera.galera_partition because it times out.
| | * | Merge 10.2 into 10.3Marko Mäkelä2019-12-137-99/+106
| | |\ \ | | | |/
| | | * MDEV-20950 Reduce size of record offsetsbb-10.2-MDEV-20950-stack-offsetsEugene Kosov2019-12-137-96/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | offset_t: this is a type which represents one record offset. It's unsigned short int. a lot of functions: replace ulint with offset_t btr_pcur_restore_position_func(), page_validate(), row_ins_scan_sec_index_for_duplicate(), row_upd_clust_rec_by_insert_inherit_func(), row_vers_impl_x_locked_low(), trx_undo_prev_version_build(): allocate record offsets on the stack instead of waiting for rec_get_offsets() to allocate it from mem_heap_t. So, reducing memory allocations. RECORD_OFFSET, INDEX_OFFSET: now it's less convenient to store pointers in offset_t* array. One pointer occupies now several offset_t. And those constant are start indexes into array to places where to store pointer values REC_OFFS_HEADER_SIZE: adjusted for the new reality REC_OFFS_NORMAL_SIZE: increase size from 100 to 300 which means less heap allocations. And sizeof(offset_t[REC_OFFS_NORMAL_SIZE]) now is 600 bytes which is smaller than previous 800 bytes. REC_OFFS_SEC_INDEX_SIZE: adjusted for the new reality rem0rec.h, rem0rec.ic, rem0rec.cc: various arguments, return values and local variables types were changed to fix numerous integer conversions issues. enum field_type_t: offset types concept was introduces which replaces old offset flags stuff. Like in earlier version, 2 upper bits are used to store offset type. And this enum represents those types. REC_OFFS_SQL_NULL, REC_OFFS_MASK: removed get_type(), set_type(), get_value(), combine(): these are convenience functions to work with offsets and it's types rec_offs_base()[0]: still uses an old scheme with flags REC_OFFS_COMPACT and REC_OFFS_EXTERNAL rec_offs_base()[i]: these have type offset_t now. Two upper bits contains type.
* | | | MDEV-21174: Remove some mlog_write_initial_log_record_fast()Marko Mäkelä2019-12-132-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass buf_block_t* to more functions that write redo log. page_zip_write_node_ptr(), page_zip_write_blob_ptr(), page_zip_compress_write_log_no_data(): Take buf_block_t* as parameter, and do not tolerate mtr=NULL. page_zip_compress(): Do not tolerate mtr=NULL. page_zip_dir_insert(): Take page_cur_t* as parameter. mlog_write_initial_log_record(): Remove. This function was unused. RecIterator::remove(): Remove the redundant page_zip parameter. PageConverter::m_page_zip_ptr: Remove.
* | | | MDEV-21174: Clean up record insertionMarko Mäkelä2019-12-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | page_cur_insert_rec_low(): Take page_cur_t* as a parameter, and do not tolerate mtr=NULL. page_cur_insert_rec_zip(): Do not tolerate mtr=NULL.
* | | | MDEV-21259 Assertion failed in mtr_t::write()Marko Mäkelä2019-12-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_free_externally_stored_field(): Pass w=mtr_t::OPT to note that the BTR_EXTERN_LEN is not necessarily changing when a multi-page ROW_FORMAT=COMPRESSED off-page column is being freed, and to allow redundant writes to the redo log to be optimized away. Ever since commit 56f6dab1d0e5a464ea49c1e5efb0032a0f5cea3e the refactored function mtr_t::write() asserts by default that the page contents is being changed.
* | | | MDEV-21205 Assertion failure in btr_sec_min_rec_markMarko Mäkelä2019-12-041-28/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit af5947f433e98d0447960da07856eb207dd09e01 the function btr_discard_page() is invoking btr_set_min_rec_mark() with the wrong buf_block_t* object. node_ptr is on merge_block, not block. btr_discard_page(): Remove the variables merge_page, page, and always refer to block->frame or merge_block->frame instead. Also, limit the scope of node_ptr and avoid duplicated conditions. btr_set_min_rec_mark(): Add a template parameter, so that the caller can specify whether the page is supposed to have a left sibling. Otherwise, the assertion (which was introduced in the same commit) would fail in btr_discard_page().
* | | | MDEV-21174: Replace mlog_write_string() with mtr_t::memcpy()Marko Mäkelä2019-12-032-23/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtr_t::memcpy(): Replaces mlog_write_string(), mlog_log_string(). The buf_block_t is passed a parameter, so that mlog_write_initial_log_record_low() can be used instead of mlog_write_initial_log_record_fast(). fil_space_crypt_t::write_page0(): Remove the fil_space_t* parameter.
* | | | MDEV-21174: Replace mlog_memset() with mtr_t::memset()Marko Mäkelä2019-12-033-59/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing buf_block_t helps us avoid calling mlog_write_initial_log_record_fast() and page_get_page_no(), and allows us to implement more debug checks, such as that on ROW_FORMAT=COMPRESSED index pages, only the page header may be modified by MLOG_MEMSET records. fseg_n_reserved_pages(): Add a buf_block_t parameter.
* | | | Cleanup: Remove some page_get_page_no() callsMarko Mäkelä2019-12-033-60/+40
| | | | | | | | | | | | | | | | | | | | Refer to buf_page_t::id instead of parsing the tablespace identifier or page number from the buffer pool page.
* | | | MDEV-21174: Replace mlog_write_ulint() with mtr_t::write()Marko Mäkelä2019-12-033-536/+501
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtr_t::write(): Replaces mlog_write_ulint(), mlog_write_ull(). Optimize away writes if the page contents does not change, except when a dummy write has been explicitly requested. Because the member function template takes a block descriptor as a parameter, it is possible to introduce better consistency checks. Due to this, the code for handling file-based lists, undo logs and user transactions was refactored to pass around buf_block_t.
* | | | MDEV-12353 preparation: Do not write MLOG_REC_MIN_MARKMarko Mäkelä2019-12-032-47/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_set_min_rec_mark(): Write MLOG_1BYTE instead of MLOG_REC_MIN_MARK or MLOG_COMP_REC_MIN_MARK. On ROW_FORMAT=COMPRESSED pages, the minimum record flag is not stored at all. The flag is computed for the uncompressed page by page_zip_decompress(). Hence, nothing needs to be logged for ROW_FORMAT=COMPRESSED tables for this operation. To facilitate crash-upgrade and hot backup from older versions, we will retain the code to parse and apply the old log record types MLOG_REC_MIN_MARK and MLOG_COMP_REC_MIN_MARK.
* | | | MDEV-21133: Remove buf_frame_copy()Marko Mäkelä2019-12-031-1/+2
| | | |
* | | | Cleanup: flst_read_addr(), fil_addr_tMarko Mäkelä2019-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fil_addr_t: Use exactly sized data types. flst_read_addr(): Remove the unused parameter mtr. page_offset(): Return uint16_t.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-271-20/+24
|\ \ \ \ | |/ / /
| * | | MDEV-21148: Assertion index->n_core_fields + n_add >= index->n_fieldsMarko Mäkelä2019-11-261-20/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert part of commit 6cedb671e99038f1a10e0d8504f835aaabed9780 because it turns out to be theoretically impossible to parse a ROW_FORMAT=COMPACT or ROW_FORMAT=DYNAMIC metadata record where the variable-length fields in the PRIMARY KEY have been written as nonempty strings.
* | | | MDEV-21133 Optimize access to InnoDB page header fieldsMarko Mäkelä2019-11-262-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce memcpy_aligned<N>(), memcmp_aligned<N>(), memset_aligned<N>() and use them for accessing InnoDB page header fields that are known to be aligned. MY_ASSUME_ALIGNED(): Wrapper for the GCC/clang __builtin_assume_aligned(). Nothing similar seems to exist in Microsoft Visual Studio, and the C++20 std::assume_aligned is not available to us yet. Explicitly specified alignment guarantees allow compilers to generate faster code on platforms with strict alignment rules, instead of emitting calls to potentially unaligned memcpy(), memcmp(), or memset().
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-201-6/+47
|\ \ \ \ | |/ / /
| * | | MDEV-21088 Table cannot be loaded after instant ADD/DROP COLUMNMarko Mäkelä2019-11-201-6/+47
| | | | | | | | | | | | | | | | | | | | | | | | btr_cur_instant_init_low(): Accurately parse the metadata record header for ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPACT. CHAR columns used to be unnecessarily written as nonempty strings of bytes.
* | | | MDEV-16264 Use threadpool for Innodb background work.Vladislav Vaintroub2019-11-152-45/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Almost all threads have gone - the "ticking" threads, that sleep a while then do some work) (srv_monitor_thread, srv_error_monitor_thread, srv_master_thread) were replaced with timers. Some timers are periodic, e.g the "master" timer. - The btr_defragment_thread is also replaced by a timer , which reschedules it self when current defragment "item" needs throttling - the buf_resize_thread and buf_dump_threads are substitutes with tasks Ditto with page cleaner workers. - purge workers threads are not tasks as well, and purge cleaner coordinator is a combination of a task and timer. - All AIO is outsourced to tpool, Innodb just calls thread_pool::submit_io() and provides the callback. - The srv_slot_t was removed, and innodb_debug_sync used in purge is currently not working, and needs reimplementation.
* | | | Cleanup: More use of mtr_memo_type_tMarko Mäkelä2019-11-151-3/+5
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-145-27/+27
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-11-145-27/+27
| |\ \ \ | | |/ /
| | * | MDEV-12353 preparation: Replace mtr_x_lock() and friendsMarko Mäkelä2019-11-145-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apart from page latches (buf_block_t::lock), mini-transactions are keeping track of at most one dict_index_t::lock and fil_space_t::latch at a time, and in a rare case, purge_sys.latch. Let us introduce interfaces for acquiring an index latch or a tablespace latch. In a later version, we may want to introduce mtr_t members for holding a latched dict_index_t* and fil_space_t*, and replace the remaining use of mtr_t::m_memo with std::set<buf_block_t*> or with a map<buf_block_t*,byte*> pointing to log records.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-131-4/+12
|\ \ \ \ | |/ / /
| * | | MDEV-17138 follow-up: Optimize index page creationMarko Mäkelä2019-11-131-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | btr_create(), btr_root_raise_and_insert(): Write a MLOG_MEMSET record to set FIL_PAGE_PREV,FIL_PAGE_NEXT to FIL_NULL, instead of writing two MLOG_4BYTES records. For ROW_FORMAT=COMPRESSED pages, we will not use MLOG_MEMSET because we want the crash-downgrade to earlier 10.4 releases to succeed. mlog_parse_nbytes(): Relax the too strict assertion. There is no problem with MLOG_MEMSET records that affect the uncompressed header of ROW_FORMAT=COMPRESSED index pages.
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-11-116-91/+68
|\ \ \ \ | |/ / /