- 17 Jan, 2024 4 commits
-
-
Vladislav Vaintroub authored
Upon further benchmarking, it turns out srw_mutex performs overall slightly better with WaitOnAddress than CRITICAL_SECTION.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
The parameter innodb_undo_log_truncate=ON enables a multi-phased logic: 1. Any "producers" (new starting transactions) are prohibited from using the rollback segments that reside in the undo tablespace. 2. Any transactions that use any of the rollback segments must be committed or aborted. 3. The purge of committed transaction history must process all the rollback segments. 4. The undo tablespace is truncated and rebuilt. 5. The rollback segments are re-enabled for new transactions. There was one flaw in this logic: The first step was not being invoked as often as it could be, and therefore innodb_undo_log_truncate=ON would have no chance to work during a heavy write workload. Independent of innodb_undo_log_truncate, even after commit 86767bcc we are missing some chances to free processed undo log pages. If we prohibited the creation of new transactions in one busy rollback segment at a time, we would be eventually guaranteed to be able to free such pages. purge_sys_t::skipped_rseg: The current candidate rollback segment for shrinking the history independent of innodb_undo_log_truncate. purge_sys_t::iterator::free_history_rseg(): Renamed from trx_purge_truncate_rseg_history(). Implement the logic around purge_sys.m_skipped_rseg. purge_sys_t::truncate_undo_space: Renamed from truncate. purge_sys.truncate_undo_space.last: Changed the type to integer to get rid of some pointer dereferencing and conditional branches. purge_sys_t::truncating_tablespace(), purge_sys_t::undo_truncate_try(): Refactored from trx_purge_truncate_history(). Set purge_sys.truncate_undo_space.current if applicable, or return an already set purge_sys.truncate_undo_space.current. purge_coordinator_state::do_purge(): Invoke purge_sys_t::truncating_tablespace() as part of the normal work loop, to implement innodb_undo_log_truncate=ON as often as possible. trx_purge_truncate_rseg_history(): Remove a redundant parameter. trx_undo_truncate_start(): Replace dead code with a debug assertion. Correctness tested by: Matthias Leich Performance tested by: Axel Schwenke Reviewed by: Debarun Banerjee
-
- 16 Jan, 2024 1 commit
-
-
Yuchen Pei authored
Since 0930eb86, system table creation needed for spider init is delayed to the signal_ddl_recovery_done callback. Since it is part of the init, failure should result in spider deinit. We also remove the call to spider_init_system_tables() from spider_db_init(), as it was removed in the commit mentioned above and accidentally restored in a merge.
-
- 13 Jan, 2024 3 commits
-
-
Paul Szabo authored
Signed-off-by: Paul Szabo psz@maths.usyd.edu.au www.maths.usyd.edu.au/u/psz School of Mathematics and Statistics University of Sydney Australia
-
Paul Szabo authored
Signed-off-by: Paul Szabo psz@maths.usyd.edu.au www.maths.usyd.edu.au/u/psz School of Mathematics and Statistics University of Sydney Australia
-
Anel Husakovic authored
-
- 11 Jan, 2024 4 commits
-
-
Dave Gosselin authored
This ticket is fixed by MDEV-32555 and this test captures a different use case.
-
Yuchen Pei authored
-
Yuchen Pei authored
All Spider tables are recorded in the system table mysql.spider_tables. Deleting a spider table removes the corresponding rows from the system table, among other things. This patch makes it so that if spider could not find any record in the system table to delete for a given table, it should correctly report that no such Spider table exists.
-
Yuchen Pei authored
The field is assigned but unused, and it causes heap-use-after-free.
-
- 10 Jan, 2024 11 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
When innodb_undo_log_truncate=ON causes an InnoDB undo tablespace to be truncated, we must guarantee that the undo tablespace will be rebuilt atomically: After mtr_t::commit_shrink() has durably written the mini-transaction that rebuilds the undo tablespace, we must not write any old pages to the tablespace. To guarantee this, in trx_purge_truncate_history() we used to traverse the entire buf_pool.flush_list in order to acquire exclusive latches on all pages for the undo tablespace that reside in the buffer pool, so that those pages cannot be written and will be evicted during mtr_t::commit_shrink(). But, this traversal may interfere with the page writing activity of buf_flush_page_cleaner(). It would be better to lazily discard the old pages of the truncated undo tablespace. fil_space_t::is_being_truncated, fil_space_t::clear_stopping(): Remove. fil_space_t::create_lsn: A new field, identifying the LSN of the latest rebuild of a tablespace. buf_page_t::flush(), buf_flush_try_neighbors(): Evict pages whose FIL_PAGE_LSN is below fil_space_t::create_lsn. mtr_t::commit_shrink(): Update fil_space_t::create_lsn and fil_space_t::size right before the log is durably written and the tablespace file is being truncated. fsp_page_create(), trx_purge_truncate_history(): Simplify the logic. Reviewed by: Thirunarayanan Balathandayuthapani, Vladislav Lesin Performance tested by: Axel Schwenke Correctness tested by: Matthias Leich
-
Marko Mäkelä authored
-
Sergei Golubchik authored
remove thr_setconcurrency() followup for 8bbcaab1 Fix by Rainer Orth
-
Sergei Golubchik authored
mark auto-inc columns for read/write on INSERT, but only for read on UPDATE
-
Yuchen Pei authored
-
Marko Mäkelä authored
trx_purge_free_segment(), trx_purge_truncate_rseg_history(): Do not claim that the blocks will be modified in the mini-transaction, because that will not always be the case. Whenever there is a modification, mtr_t::set_modified() will flag it. The debug assertion that failed in recovery is checking that all changes to data pages are covered by log records. Due to these incorrect calls, we would unnecessarily write unmodified data pages, which is something that commit 05fa4558 aims to avoid. The incorrect calls had originally been added in commit de31ca6a (MDEV-32820) and commit 86767bcc (MDEV-29593). Reviewed by: Vladislav Lesin Tested by: Elena Stepanova
-
Yuchen Pei authored
When the host is not specified, it defaults to localhost.
-
Yuchen Pei authored
A new column was introduced to the show index output in 10.6 in f691d986 Thus we update the check of the number of columns to be at least 13, rather than exactly 13. Also backport an err number and format from 10.5 for better error messages when the column number is wrong.
-
Rainer Orth authored
There are a large number of uses of `strerror` in the codebase, the local declaration in `storage/connect/tabvct.cpp` is the only one. Given that none is needed elsewhere, I conclude that this instance can simply be removed.
-
- 09 Jan, 2024 8 commits
-
-
Sergei Golubchik authored
perfschema thread walker needs to take thread's LOCK_thd_kill to prevent the thread from disappearing why it's being looked at. But there's no need to lock it for the current thread. In fact, it was harmful as some code down the stack might take LOCK_thd_kill (e.g. set_killed() does it, and my_malloc_size_cb_func() calls set_killed()). And it caused a bunch of mutexes being locked under LOCK_thd_kill, which created problems later when my_malloc_size_cb_func() called set_killed() at some unspecified point under some random mutexes.
-
Sergei Golubchik authored
-
Sergei Golubchik authored
same assertion with spider. spider status variables didn't expect to be queried from a different thread without LOCK_thd_data. And they didn't expect to be queried under LOCK_thd_data either (because spider_get_trx() calls thd_set_ha_data()).
-
Sergei Golubchik authored
reduce code duplication
-
Sergei Golubchik authored
need to protect access to thread-local cache_mngr with LOCK_thd_data technically only access from different threads has to be protected, but this is the SHOW STATUS code path, so the difference is neglectable
-
Sergei Golubchik authored
use utf8mb4 with PCRE2, not utf8mb3
-
Sergei Golubchik authored
initialize THD::rand in THD::init() not in THD::THD(), because the former is also called when a THD is reused - in COM_CHANGE_USER and in taking a THD from the cache. Also use current cycle timer for more unpreditability
-
Alexander Barkov authored
Item_float::neg() did not preserve the "presentation" from "this". So CAST(-1e0 AS UNSIGNED) -- cast from double to unsigned changes its meaning to: CAST(-1 AS UNSIGNED) -- cast signed to undigned Fixing Item_float::neg() to construct the new value for Item_float::presentation as follows: - if the old value starts with minus, then the minus is truncated: '-2e0' -> '2e0' - otherwise, minus sign followed by its old value: '1e0' -> '-1e0'
-
- 08 Jan, 2024 6 commits
-
-
Yuchen Pei authored
The bitmap is temporarily flipped to ~0 for the sake of checking all fields. It needs to be restored because it will be reused in second and subsequent ps execution.
-
Sergei Golubchik authored
Fix by Rainer Orth
-
Sergei Golubchik authored
Fix by Rainer Orth
-
Sergei Golubchik authored
With the result like encryption.innochecksum 'debug' [ skipped ] combination not found instead of *** ERROR: Could not run encryption.innochecksum with 'debug' combination(s)
-
Marko Mäkelä authored
-
Marko Mäkelä authored
buf_flush_page_cleaner(): A continue or break inside DBUG_EXECUTE_IF actually is a no-op. Use an explicit call to _db_keyword_() to actually avoid advancing the checkpoint. buf_flush_list_now_set(): Invoke os_aio_wait_until_no_pending_writes() to ensure that the page write to the system tablespace is completed.
-
- 04 Jan, 2024 1 commit
-
-
Marko Mäkelä authored
In commit b4ff6456 the signature of mysql_show_var_func was changed, but not all functions of that type were adjusted. When the server is configured with `cmake -DWITH_ASAN=ON` and compiled with clang, runtime errors would be flagged for invoking functions through an incompatible function pointer. Reviewed by: Michael 'Monty' Widenius
-
- 03 Jan, 2024 2 commits
-
-
Igor Babaev authored
If a query contained a CTE whose name coincided with the name of one of the base tables used in the specification of the CTE and the query had at least two references to this CTE in the specifications of other CTEs then processing of the query led to unlimited recursion that ultimately caused a crash of the server. Any secondary non-recursive reference to a CTE requires creation of a copy of the CTE specification. All the references to CTEs in this copy must be resolved. If the specification contains a reference to a base table whose name coincides with the name of then CTE then it should be ensured that this reference in no way can be resolved against the name of the CTE.
-
Marko Mäkelä authored
-