- 19 Nov, 2021 4 commits
-
-
Marko Mäkelä authored
The following options were introduced in commit 2e814d47 (mariadb-10.2.2) and have little use: innodb_disable_resize_buffer_pool_debug had no effect even in MariaDB 10.2.2 or MySQL 5.7.9. It was introduced in mysql/mysql-server@5c4094cf4971eebab89da4ee4ae92c71f69cd524 to work around a problem that was fixed in mysql/mysql-server@2957ae4f990bf3aed25822b0ce15d3ccad0b54b6 (but the parameter was not removed). innodb_page_cleaner_disabled_debug and innodb_master_thread_disabled_debug are only used by the test innodb.redo_log_during_checkpoint that will be removed as part of this commit. innodb_dict_stats_disabled_debug is only used by that test, and it is redundant because one could simply use innodb_stats_persistent=OFF or the STATS_PERSISTENT=0 attribute of the table in the test to achieve the same effect.
-
Marko Mäkelä authored
-
Aleksey Midenkov authored
32-bit variable must be expanded to 64-bit before shift left.
-
Marko Mäkelä authored
-
- 18 Nov, 2021 5 commits
-
-
Marko Mäkelä authored
buf_page_t::frame: Moved from buf_block_t::frame. All 'thin' buf_page_t describing compressed-only ROW_FORMAT=COMPRESSED pages will have frame=nullptr, while all 'fat' buf_block_t will have a non-null frame pointing to aligned innodb_page_size bytes. This eliminates the need for separate states for BUF_BLOCK_FILE_PAGE and BUF_BLOCK_ZIP_PAGE. buf_page_t::lock: Moved from buf_block_t::lock. That is, all block descriptors will have a page latch. The IO_PIN state that was used for discarding or creating the uncompressed page frame of a ROW_FORMAT=COMPRESSED block is replaced by a combination of read-fix and page X-latch. page_zip_des_t::fix: Replaces state_, buf_fix_count_, io_fix_, status of buf_page_t with a single std::atomic<uint32_t>. All modifications will use store(), fetch_add(), fetch_sub(). This space was previously wasted to alignment on 64-bit systems. We will use the following encoding that combines a state (partly read-fix or write-fix) and a buffer-fix count: buf_page_t::NOT_USED=0 (previously BUF_BLOCK_NOT_USED) buf_page_t::MEMORY=1 (previously BUF_BLOCK_MEMORY) buf_page_t::REMOVE_HASH=2 (previously BUF_BLOCK_REMOVE_HASH) buf_page_t::FREED=3 + fix: pages marked as freed in the file buf_page_t::UNFIXED=1U<<29 + fix: normal pages buf_page_t::IBUF_EXIST=2U<<29 + fix: normal pages; may need ibuf merge buf_page_t::REINIT=3U<<29 + fix: reinitialized pages (skip doublewrite) buf_page_t::READ_FIX=4U<<29 + fix: read-fixed pages (also X-latched) buf_page_t::WRITE_FIX=5U<<29 + fix: write-fixed pages (also U-latched) buf_page_t::WRITE_FIX_IBUF=6U<<29 + fix: write-fixed; may have ibuf buf_page_t::WRITE_FIX_REINIT=7U<<29 + fix: write-fixed (no doublewrite) buf_page_t::write_complete(): Change WRITE_FIX or WRITE_FIX_REINIT to UNFIXED, and WRITE_FIX_IBUF to IBUF_EXIST, before releasing the U-latch. buf_page_t::read_complete(): Renamed from buf_page_read_complete(). Change READ_FIX to UNFIXED or IBUF_EXIST, before releasing the X-latch. buf_page_t::can_relocate(): If the page latch is being held or waited for, or the block is buffer-fixed or io-fixed, return false. (The condition on the page latch is new.) Outside buf_page_get_gen(), buf_page_get_low() and buf_page_free(), we will acquire the page latch before fix(), and unfix() before unlocking. buf_page_t::flush(): Replaces buf_flush_page(). Optimize the handling of FREED pages. buf_pool_t::release_freed_page(): Assume that buf_pool.mutex is held by the caller. buf_page_t::is_read_fixed(), buf_page_t::is_write_fixed(): New predicates. buf_page_get_low(): Ignore guesses that are read-fixed because they may not yet be registered in buf_pool.page_hash and buf_pool.LRU. buf_page_optimistic_get(): Acquire latch before buffer-fixing. buf_page_make_young(): Leave read-fixed blocks alone, because they might not be registered in buf_pool.LRU yet. recv_sys_t::recover_deferred(), recv_sys_t::recover_low(): Possibly fix MDEV-26326, by holding a page X-latch instead of only buffer-fixing the page.
-
Marko Mäkelä authored
MDEV-23855 and MDEV-23399 already moved some transient data fields from buffer pool page descriptors to IORequest, but the write buffer of PAGE_COMPRESSED or ENCRYPTED tables was missed. Since is only needed during asynchronous page write requests, it belongs to IORequest.
-
Marko Mäkelä authored
btr_cur_optimistic_latch_leaves(): Use transactional_shared_lock_guard. btr_cur_latch_leaves(): Avoid acquiring some page latches, because the changes are already blocked by index->lock. btr_cur_search_to_nth_level_func(): Remove a redundant variable retrying_for_search_prev=!!prev_tree_blocks, and avoid acquiring some page latches.
-
Marko Mäkelä authored
dict_stats_recalc_pool_del(): Always reposition the iterators after releasing and reacquiring the mutex. Another thread could have modified recalc_pool, causing reallocation of the underlying memory while we were waiting. This fixes a regression that was caused by commit 45a05fda (MDEV-25919).
-
Marko Mäkelä authored
-
- 17 Nov, 2021 7 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
MDEV-23805 simplified the treatment of empty tables during ALTER TABLE, which could prevent the scenarios that were previously reported and fixed as MDEV-16131 and MDEV-24730. With the MDEV-23805 fix, the statement SET DEBUG_SYNC = 'now WAIT_FOR copied'; could occasionally time out, depending on timing. Apparently, there was a race condition where purge could resume (and empty the table) before ALTER TABLE got the chance to execute. We must prevent the purge of history from running before ALTER TABLE has started executing.
-
Eugene Kosov authored
fil_space_decrypt(): change signature to return status via dberr_t only. Also replace impossible condition with an assertion and prove it via test cases.
-
Igor Babaev authored
This bug affected queries with two or more references to a CTE referring another CTE if the definition of the latter contained an invocation of a stored function that used a base table. The bug could lead to a bogus error message or to an assertion failure. For any non-first reference to CTE cte1 With_element::clone_parsed_spec() is called that parses the specification of cte1 to construct the unit structure for this usage of cte1. If cte1 refers to another CTE cte2 outside of the specification of cte1 then With_element::clone_parsed_spec() has to be called for cte2 as well. This call is made by the function LEX::resolve_references_to_cte() within the invocation of the function With_element::clone_parsed_spec() for cte1. When the specification of a CTE is parsed all table references encountered in it must be added to the global list of table references for the query. As the specification for the non-first usage of a CTE is parsed at a recursive call of the parser the function With_element::clone_parsed_spec() invoked at this recursive call should takes care of appending the list of table references encountered in the specification of this CTE cte1 to the list of table references created for the query. And it should do it after the call of LEX::resolve_references_to_cte() that resolves references to CTEs defined outside of the specification of cte1 because this call may invoke the parser again for specifications of other CTEs and the table references from their specifications must ultimately appear in the global list of table references of the query. The code of With_element::clone_parsed_spec() misplaced the call of LEX::resolve_references_to_cte(). As a result LEX::query_tables_last used for the query that was supposed to point to the field 'next_global' of the last element in the global list of table references actually pointed to 'next_global' of the previous element. The above inconsistency certainly caused serious problems when table references used in the stored functions invoked in cloned specifications of CTEs were added to the global list of table references.
-
- 16 Nov, 2021 9 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
In commit 7ae21b18 (MDEV-12353) the recovery of ROW_FORMAT=COMPRESSED tables was changed. Changes would be logged in a physical format for the compressed page image, so that the page need not be decompressed or compressed during recovery. page_zip_write_rec(): Log any update of the delete-mark flag in the ROW_FORMAT=COMPRESSED page. page_zip_dir_insert(): Copy the delete-mark flag. A delete-marked record may be inserted by btr_cur_pessimistic_update() via btr_cur_insert_if_possible(), page_cur_tuple_insert(), page_cur_insert_rec_zip(). In the observed scenario, it was an ROLLBACK. Presumably, the test case involved repeated DELETE and INSERT of the same key, or updating a key back and forth. This change alone might make the adjustment in page_zip_write_rec() redundant, but we play it safe because we failed to create a minimal test case for this scenario.
-
Marko Mäkelä authored
If the server is killed during any DDL operation that is about to delete an .ibd file, recovery could crash when attempting to load the table definition of the being-dropped table. By design of commit 1bd681c8 (MDEV-25506 part 3), a table whose name starts with #sql-ib in the data dictionary may belong to an uncommitted transaction. So, we must ignore any missing SYS_COLUMNS, SYS_FIELDS, and SYS_VIRTUAL records for such tables. The "ID mismatch" error messages were misleading; they really mean "record not found".
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
Rows_log_event::do_apply_event(): Correct the mistake that was made in the merge 5f8561a6. In Galera, the query cache will be invalidated near the end of the function.
-
Marko Mäkelä authored
buf_flush_check_neighbors(): Relax a debug assertion that could fail for the very last page(s) of a ROW_FORMAT=COMPRESSED tables using a 1024-byte or 2048-byte page size. This assertion started to fail after commit d09426f9 (MDEV-26537) modified the .ibd file extension to occur in steps of 4096 bytes.
-
Vladislav Vaintroub authored
-
Vladislav Vaintroub authored
-
- 13 Nov, 2021 1 commit
-
-
Vladislav Vaintroub authored
reapply patch 96b472c0 It was not merged correctly into 10.5+
-
- 12 Nov, 2021 1 commit
-
-
Thirunarayanan Balathandayuthapani authored
- In ha_innobase::prepare_inplace_alter_table(), InnoDB should check whether the table is empty. If the table is empty then server should avoid downgrading the MDL after prepare phase. It is more like instant alter, does change only in dicationary and metadata. - Changed few debug test case to make non-empty DDL table
-
- 11 Nov, 2021 7 commits
-
-
Vladislav Vaintroub authored
-
Vladislav Vaintroub authored
-
Vladislav Vaintroub authored
Upon investigation, decided this to be a compiler bug (happens with new compiler, on code that did not change for the last 15 years) Fixed by de-optimizing single function remove_key(), using MSVC pragma
-
Vladislav Vaintroub authored
-
Vladislav Vaintroub authored
-
Vladislav Vaintroub authored
Upon investigation, decided this to be a compiler bug (happens with new compiler, on code that did not change for the last 15 years) Fixed by de-optimizing single function remove_key(), using MSVC pragma
-
Brandon Nesterenko authored
MDEV-26991: CURRENT_TEST: main.mysql_binary_zero_insert 'grep' is not recognized as an internal or external command, operable program or batch file. Removed grep from mysqldump command stream and instead, extend the search_file pattern to search for rows containing binary zeros instead of any occurance of '00' in the input
-
- 10 Nov, 2021 2 commits
-
-
Sergei Krivonos authored
-
Thirunarayanan Balathandayuthapani authored
In dict_index_t::clear(), InnoDB frees all the page except root page. root page leaf segment has reset and does reinitialize again. t in fseg_create(), we do have the assumption that only FIL_PAGE_TYPE_TRX_SYS or FIL_PAGE_TYPE_TRX_SYS page should be re-created for non-full-crc32 format. This assumption is wrong in case of rollback of bulk insert operation.
-
- 09 Nov, 2021 4 commits
-
-
Sergei Petrunia authored
-
Vladislav Vaintroub authored
If it is not enabled, build wsrep as static "stub" library from wsrep_dummy.cc ´ Allow static plugins to export symbols (on Unix) wsrep_info relies on wsrep defined symbols (e.g LOCK_wsrep_config_state) exported from mysqld
-
Vladislav Vaintroub authored
-
Vladislav Vaintroub authored
Means, plugin will not be available in embedded, even if compiled-in
-