- 01 Aug, 2023 5 commits
-
-
Oleksandr Byelkin authored
-
Marko Mäkelä authored
buf_page_t::write_complete(), buf_page_write_complete(), IORequest::write_complete(): Add a parameter for passing an error code. If an error occurred, we will release the io-fix, buffer-fix and page latch but not reset the oldest_modification field. The block would remain in buf_pool.LRU and possibly buf_pool.flush_list, to be written again later, by buf_flush_page_cleaner(). If all page writes start consistently failing, all write threads should eventually hang in log_free_check() because the log checkpoint cannot be advanced to make room in the circular write-ahead-log ib_logfile0. IORequest::read_complete(): Add a parameter for passing an error code. If a read operation fails, we report the error and discard the page, just like we would do if the page checksum was not validated or the page could not be decrypted. This only affects asynchronous reads, due to linear or random read-ahead or crash recovery. When buf_page_get_low() invokes buf_read_page(), that will be a synchronous read, not involving this code. This was tested by randomly injecting errors in write_io_callback() and read_io_callback(), like this: if (!ut_rnd_interval(100)) cb->m_err= 42;
-
Marko Mäkelä authored
buf_LRU_free_page(): The block may also be in the IBUF_EXIST state when executing the test innodb.innodb_bulk_create_index_debug.
-
Oleksandr Byelkin authored
-
Marko Mäkelä authored
buf_LRU_free_page(): When we are discarding the uncompressed copy of a ROW_FORMAT=COMPRESSED page, buf_page_t::can_relocate() must have ensured that the block descriptor state is one of FREED, UNFIXED, REINIT. Do not overwrite the state with UNFIXED. We do not want to write back pages that were actually freed, and we want to avoid doublewrite for pages that were (re)initialized by log records written since the latest checkpoint. Last but not least, we do not want crashes like those that commit dc1bd180 (MDEV-31386) was supposed to fix. The test innodb_zip.wl5522_zip should typically cover all 3 states. This bug is a regression due to commit aaef2e1d (MDEV-27058).
-
- 31 Jul, 2023 6 commits
-
-
Sergei Golubchik authored
failed SHOW CREATE FUNCTION means we don't dump this function, but should still try to dump all other functions
-
Sergei Golubchik authored
don't construct open ranges from prefix blob keys for < (less than) just as it's already done for > (greater than) because prefix KEY_PART doesn't create prefix Field for blobs (see open_table_from_share() near "Create a new field for the key part"), so stored_field_cmp_to_item() will compare the original field to the value not taking the prefix length into account.
-
Sergei Golubchik authored
-
Aleksey Midenkov authored
This reverts commit add0c01b Duplicates must be avoided in FTS_DOC_ID_INDEX
-
Oleksandr Byelkin authored
-
Marko Mäkelä authored
-
- 30 Jul, 2023 3 commits
-
-
Kristian Nielsen authored
(It's not using include/rpl_init.inc, so it needs to reset the GTID position explicitly). Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
-
Kristian Nielsen authored
A simple "SET SESSION gtid_seq_no= DEFAULT" did not work, it would straight up crash the server! Also, explicitly setting gtid_seq_no to 0 gave an error in --gtid-strict-mode=1. Setting to DEFAULT or 0 should disable any prior setting of gtid_seq_no, so that the next transaction is allocated the next GTID in sequence, as normal. Reviewed-by: Monty <monty@mariadb.org> Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
-
Monty authored
-
- 29 Jul, 2023 1 commit
-
-
Julius Goryavsky authored
-
- 28 Jul, 2023 2 commits
-
-
Marko Mäkelä authored
log_sort_flush_list(): Wait for any pending page writes to cease before sorting the buf_pool.flush_list. Starting with commit 22b62eda (MDEV-25113), it is possible that some buf_page_t::oldest_modification_ that we will be comparing in std::sort() will be updated from some value >2 to 1 while we are holding buf_pool.flush_list_mutex. To catch this type of trouble better in the future, we will clean garbage (pages that have been written out) from buf_pool.flush_list while constructing the array for sorting, and check with debug assertions that all blocks that we are copying from the array to the list will be dirty (requiring a writeback) while we sort and copy the array back to buf_pool.flush_list. This failure was observed by chance exactly once when running the test innodb.recovery_memory. It was never reproduced in the same form afterwards. Unrelated to this change, the test does occasionally reproduce a failure to start up InnoDB due to a corrupted page being read in recovery. The ticket MDEV-31791 was filed for that. Tested by: Matthias Leich
-
Marko Mäkelä authored
-
- 27 Jul, 2023 2 commits
-
-
Aleksey Midenkov authored
differently react to SQL_MODE => unusable SHOW CREATE Use abort_on_warning dependent on strict mode over create new table like it is done for copy data and inplace alter.
-
Oleksandr Byelkin authored
-
- 26 Jul, 2023 4 commits
-
-
Oleksandr Byelkin authored
-
Lena Startseva authored
This patch adds for "--ps-protocol" second execution of queries "SELECT". Also in this patch it is added ability to disable/enable (--disable_ps2_protocol/--enable_ps2_protocol) second execution for "--ps-prototocol" in testcases.
-
Geoff Montee authored
-
Lena Startseva authored
MDEV-31407: Add aliases in opt_trace.test for long column name for removing "--disable-view-protocol" Change tests: opt_trace.test opt_trace_index_merge.test opt_trace_ucs2.test
-
- 25 Jul, 2023 4 commits
-
-
Oleksandr Byelkin authored
-
Brandon Nesterenko authored
MDEV-31749 sporadic assert in MDEV-30619 new test If the workers of a parallel replica are busy (potentially with long queues), but the SQL thread has no events left to distribute (so it goes idle), then the next event that comes from the primary will update mi->last_master_timestamp with its timestamp, even if the workers have not yet finished. This patch changes the parallel replica logic which updates last_master_timestamp after idling from using solely sql_thread_caught_up (added in MDEV-29639) to using the latter with rli queued/dequeued event counters. That is, if the queued count is equal to the dequeued count, it means all events have been processed and the replica is considered idle when the driver thread has also distributed all events. Low level details of the commit include - to make a more generalized test for Seconds_Behind_Master on the parallel replica, rpl_delayed_parallel_slave_sbm.test is renamed to rpl_parallel_sbm.test for this purpose. - pause_sql_thread_on_next_event usage was removed with the MDEV-30619 fixes. Rather than remove it, we adapt it to the needs of this test case - added test case to cover SBM spike of relay log read and LMT update that was fixed by MDEV-29639 - rpl_seconds_behind_master_spike.test is made to use the negate_clock_diff_with_master debug eval. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
-
Marko Mäkelä authored
The main problem is that at ever since commit aaef2e1d removed the function buf_wait_for_read(), it is not safe to invoke buf_page_get_low() with RW_NO_LATCH, that is, only buffer-fixing the page. If a page read (or decryption or decompression) is in progress, there would be a race condition when executing consistency checks, and a page would wrongly be flagged as corrupted. Furthermore, if the page is actually corrupted and the initial access to it was with RW_NO_LATCH (only buffer-fixing), the page read handler would likely end up in an infinite loop in buf_pool_t::corrupted_evict(). It is not safe to invoke mtr_t::upgrade_buffer_fix() on a block on which a page latch was not initially acquired in buf_page_get_low(). btr_block_reget(): Remove the constant parameter rw_latch=RW_X_LATCH. btr_block_get(): Assert that RW_NO_LATCH is not being used, and change the parameter type of rw_latch. btr_pcur_move_to_next_page(), innobase_table_is_empty(): Adjust for the parameter type change of btr_block_get(). btr_root_block_get(): If mode==RW_NO_LATCH, do not check the integrity of the page, because it is not safe to do so. btr_page_alloc_low(), btr_page_free(): If the root page latch is not previously held by the mini-transaction, invoke btr_root_block_get() again with the proper latching mode. btr_latch_prev(): Helper function to safely acquire a latch on a preceding sibling page while holding a latch on a B-tree page. To avoid deadlocks, we must not wait for the latch while holding a latch on the current page, because another thread may be waiting for our page latch when moving to the next page from our preceding sibling page. If s_lock_try() or x_lock_try() on the preceding page fails, we must release the current page latch, and wait for the latch on the preceding page as well as the current page, in that order. Page splits or merges will be prevented by the parent page latch that we are holding. btr_cur_t::search_leaf(): Make use of btr_latch_prev(). btr_cur_t::open_leaf(): Make use of btr_latch_prev(). Do not invoke mtr_t::upgrade_buffer_fix() (when latch_mode == BTR_MODIFY_TREE), because we will already have acquired all page latches upfront. btr_cur_t::pessimistic_search_leaf(): Do acquire an exclusive index latch before accessing the page. Make use of btr_latch_prev().
-
Yuchen Pei authored
We introduce simple plugin dependency. A plugin init function may return HA_ERR_RETRY_INIT. If this happens during server startup when the server is trying to initialise all plugins, the failed plugins will be retried, until no more plugins succeed in initialisation or want to be retried. This will fix spider init bugs which is caused in part by its dependency on Aria for initialisation. The reason we need a new return code, instead of treating every failure as a request for retry, is that it may be impossible to clean up after a failed plugin initialisation. Take InnoDB for example, it has a global variable `buf_page_cleaner_is_active`, which may not satisfy an assertion during a second initialisation try, probably because InnoDB does not expect the initialisation to be called twice.
-
- 24 Jul, 2023 3 commits
-
-
Marko Mäkelä authored
row_ins_sec_index_entry_low(): Correct a condition that was inadvertently inverted in commit 89ec4b53 (MDEV-29603). We are not supposed to buffer INSERT operations into unique indexes, because duplicate key values would not be checked for. It is only allowed when using unique_checks=0, and in that case the user is supposed to guarantee that there are no duplicates.
-
Oleksandr Byelkin authored
-
-
- 23 Jul, 2023 2 commits
-
-
Georg Richter authored
Since TLS server certificate verification is a client only option, this flag is removed in both client (C/C) and MariaDB server capability flags. This patch reverts commit 89d759b9 (MySQL Bug #21543) and stores the server certificate validation option in mysql->options.extensions.
-
Georg Richter authored
Since TLS server certificate verification is a client only option, this flag is removed in both client (C/C) and MariaDB server capability flags. This patch reverts commit 89d759b9 (MySQL Bug #21543) and stores the server certificate validation option in mysql->options.extensions.
-
- 21 Jul, 2023 3 commits
-
-
Sergei Petrunia authored
ANALYZE FORMAT=JSON output now includes table.r_engine_stats which has the engine statistics. Only non-zero members are printed. Internally: EXPLAIN data structures Explain_table_acccess and Explain_update now have handler* handler_for_stats pointer. It is used to read statistics from handler_for_stats->handler_stats. The following applies only to 10.9+, backport doesn't use it: Explain data structures exist after the tables are closed. We avoid walking invalid pointers using this: - SQL layer calls Explain_query::notify_tables_are_closed() before closing tables. - After that call, printing of JSON output is disabled. Non-JSON output can be printed but we don't access handler_for_stats when doing that.
-
Daniel Black authored
noinline attribute was being ignored by clang-16 and reporting 32 stack size on Gentoo, 16 locally on Fedora 38. Based on https://stackoverflow.com/questions/54481855/clang-ignoring-attribute-noinline appended noopt in addition to the gcc recognised attributes. After that the -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) returned 1056, simlar to gcc. From https://bugs.gentoo.org/910188. Thanks Zhixu Liu for the great bug report.
-
Oleksandr Byelkin authored
-
- 20 Jul, 2023 5 commits
-
-
Aleksey Midenkov authored
Restrict vcol_cleanup_expr() in close_thread_tables() to only simple locked tables mode. Prelocked is cleaned up like normal statement: in close_thread_table().
-
Aleksey Midenkov authored
First UPDATE under START TRANSACTION does nothing (nstate= nstate), but anyway generates history. Since update vector is empty we get into (!uvect->n_fields) branch which only adds history row, but does not do update. After that we get current row with wrong (old) row_start value and because of that second UPDATE tries to insert history row again because it sees trx->id != row_start which is the guard to avoid inserting multiple trx_id-based history rows under same transaction (because we have same trx_id and we get duplicate error and this bug demostrates that). But this try anyway fails because PK is based on row_end which is constant under same transaction, so PK didn't change. The fix moves vers_make_update() to an earlier stage of calc_row_difference(). Therefore it prepares update vector before (!uvect->n_fields) check and never gets into that branch, hence no need to handle versioning inside that condition anymore. Now trx->id and row_start are equal after first UPDATE and we don't try to insert second history row. == Cleanups and improvements == ha_innobase::update_row(): vers_set_fields and vers_ins_row are cleaned up into direct condition check. SQLCOM_ALTER_TABLE check now is not used as this is dead code, assertion is done instead. upd_node->is_delete is set in calc_row_difference() just to keep versioning code as much in one place as possible. vers_make_delete() is still located in row_update_for_mysql() as this is required for ha_innodbase::delete_row() as well. row_ins_duplicate_error_in_clust(): Restrict DB_FOREIGN_DUPLICATE_KEY to the better conditions. VERSIONED_DELETE is used specifically to help lower stack to understand what caused current insert. Related to MDEV-29813.
-
Aleksey Midenkov authored
On create table tmp as select ... we exited Item_func::fix_fields() with error. fix_fields_if_needed('foo' or 'bar') failed and we returned true, but already changed const_item_cache. So the item is in inconsistent state: fixed == false and const_item_cache == false. Now we cleanup the item before the return if Item_func::fix_fields() fails to process.
-
Aleksey Midenkov authored
Use vers_check_update() to avoid inserting history row for ODKU if now versioned fields specified in update_fields.
-
Aleksey Midenkov authored
Constraints processing row_ins_check_foreign_constraint() was not called because row_upd_check_references_constraints() didn't see update as delete: node->is_delete was false. Since MDEV-30378 we check for TRG_EVENT_DELETE to detect versioned delete in ha_innobase::update_row(). Now we can use TRG_EVENT_DELETE to set upd_node->is_delete, so constraints processing is triggered correctly.
-