- 19 May, 2023 9 commits
-
-
Marko Mäkelä authored
srv_export_innodb_status(): Update export_vars.innodb_buffer_pool_read_requests as it was done before commit a55b951e (MDEV-26827). If innodb_status_variables[] pointed to a sharded variable, it would only access the first shard.
-
Marko Mäkelä authored
innodb_counter_info[]: Revert a change that was accidentally made in commit 204e7225
-
Marko Mäkelä authored
This is a 10.6 port of commit 2f9e2647 from MariaDB Server 10.9 that is missing some optimization due to a more complex redo log format and recovery logic (which was simplified in commit 685d958e). The progress reporting of InnoDB crash recovery was rather intermittent. Nothing was reported during the single-threaded log record parsing, which could consume minutes when parsing a large log. During log application, there only was progress reporting in background threads that would be invoked on data page read completion. The progress reporting here will be detailed like this: InnoDB: Starting crash recovery from checkpoint LSN=628599973,5653727799 InnoDB: Read redo log up to LSN=1963895808 InnoDB: Multi-batch recovery needed at LSN 2534560930 InnoDB: Read redo log up to LSN=3312233472 InnoDB: Read redo log up to LSN=1599646720 InnoDB: Read redo log up to LSN=2160831488 InnoDB: To recover: LSN 2806789376/2806819840; 195082 pages InnoDB: To recover: LSN 2806789376/2806819840; 63507 pages InnoDB: Read redo log up to LSN=3195776000 InnoDB: Read redo log up to LSN=3687099392 InnoDB: Read redo log up to LSN=4165315584 InnoDB: To recover: LSN 4374395699/4374440960; 241454 pages InnoDB: To recover: LSN 4374395699/4374440960; 123701 pages InnoDB: Read redo log up to LSN=4508724224 InnoDB: Read redo log up to LSN=5094550528 InnoDB: To recover: 205230 pages The previous messages "Starting a batch to recover" or "Starting a final batch to recover" will be replaced by "To recover: ... pages" messages. If a batch lasts longer than 15 seconds, then there will be progress reports every 15 seconds, showing the number of remaining pages. For the non-final batch, the "To recover:" message includes two end LSN: that of the batch, and of the recovered log. This is the primary measure of progress. The batch will end once the number of pages to recover reaches 0. If recovery is possible in a single batch, the output will look like this, with a shorter "To recover:" message that counts only the remaining pages: InnoDB: Starting crash recovery from checkpoint LSN=628599973,5653727799 InnoDB: Read redo log up to LSN=1984539648 InnoDB: Read redo log up to LSN=2710875136 InnoDB: Read redo log up to LSN=3358895104 InnoDB: Read redo log up to LSN=3965299712 InnoDB: Read redo log up to LSN=4557417472 InnoDB: Read redo log up to LSN=5219527680 InnoDB: To recover: 450915 pages We will also speed up recovery by improving the memory management and implementing multi-threaded recovery of data pages that will not need to be read into the buffer pool ("fake read"). Log application in the "fake read" threads will be protected by an atomic being_recovered field and exclusive buf_page_t::lock. Recovery will reserve for data pages two thirds of the buffer pool, or 256 pages, whichever is smaller. Previously, we could only use at most one third of the buffer pool for buffered log records. This would typically mean that with large buffer pools, recovery unnecessary consisted of multiple batches. If recovery runs out of memory, it will "roll back" or "rewind" the current mini-transaction. The recv_sys.recovered_lsn and recv_sys.pages will correspond to the "out of memory LSN", at the end of the previous complete mini-transaction. If recovery runs out of memory while executing the final recovery batch, we can simply invoke recv_sys.apply(false) to make room, and resume parsing. If recovery runs out of memory before the final batch, we will scan the redo log to the end and check for any missing or inconsistent files. In this version of the patch, we will throw away any previously buffered recv_sys.pages and rescan the log from the checkpoint onwards. recv_sys_t::pages_it: A cached iterator to recv_sys.pages. recv_sys_t::is_memory_exhausted(): Remove. We will have out-of-memory handling deep inside recv_sys_t::parse(). recv_sys_t::rewind(), page_recv_t::recs_t::rewind(): Remove all log starting with a specific LSN. IORequest::write_complete(), IORequest::read_complete(): Replaces fil_aio_callback(). read_io_callback(), write_io_callback(): Replaces io_callback(). IORequest::fake_read_complete(), fake_io_callback(), os_fake_read(): Process a "fake read" request for concurrent recovery. recv_sys_t::apply_batch(): Choose a number of successive pages for a recovery batch. recv_sys_t::erase(recv_sys_t::map::iterator): Remove log records for a page whose recovery is not in progress. Log application threads will not invoke this; they will only set being_recovered=-1 to indicate that the entry is no longer needed. recv_sys_t::garbage_collect(): Remove all being_recovered=-1 entries. recv_sys_t::wait_for_pool(): Wait for some space to become available in the buffer pool. mlog_init_t::mark_ibuf_exist(): Avoid calls to recv_sys::recover_low() via ibuf_page_exists() and buf_page_get_low(). Such calls would lead to double locking of recv_sys.mutex, which depending on implementation could cause a deadlock. We will use lower-level calls to look up index pages. buf_LRU_block_remove_hashed(): Disable consistency checks for freed ROW_FORMAT=COMPRESSED pages. Their contents could be uninitialized garbage. This fixes an occasional failure of the test innodb.innodb_bulk_create_index_debug. Tested by: Matthias Leich
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
trx_purge_free_segment(), trx_purge_truncate_rseg_history(): Replace some unreachable code with debug assertions. A buffer-fix does prevent pages from being evicted from the buffer pool; see buf_page_t::can_relocate(). Tested by: Matthias Leich
-
Marko Mäkelä authored
-
Marko Mäkelä authored
trx_purge_truncate_history(): Only call trx_purge_truncate_rseg_history() if the rollback segment is safe to process. This will avoid leaking undo log pages that are not yet ready to be processed. This fixes a regression that was introduced in commit 0de3be8c (MDEV-30671). trx_sys_t::any_active_transactions(): Separately count XA PREPARE transactions. srv_purge_should_exit(): Terminate slow shutdown if the history size does not change and XA PREPARE transactions exist in the system. This will avoid a hang of the test innodb.recovery_shutdown. Tested by: Matthias Leich
-
- 18 May, 2023 1 commit
-
-
Otto Kekäläinen authored
The CODEOWNERS was added almost 3 years ago but never saw any adoption. Only one person used it (me) to mark what files I maintain and for which I wish to review commits. No other maintainers or code paths were added, so clean it away for clarity.
-
- 15 May, 2023 1 commit
-
-
Marko Mäkelä authored
-
- 12 May, 2023 3 commits
-
-
Tuukka Pasanen authored
Add Modern Perl headers. Perl 5.16 is still fairly old from 2012. Enable UTF-8, warnings and make script 'strict' Small fixes for perlcritic reported problems and some crashes I/O layer ":utf8" used at line 268, column 16. Use ":encoding(UTF-8)" to get strict validation. (Severity: 5) "return" statement with explicit "undef" at line 806, column 4. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 6844, column 4. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 7524, column 4. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 7527, column 4. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 7599, column 4. See page 199 of PBP. (Severity: 5) "return" statement with explicit "undef" at line 7602, column 4. See page 199 of PBP. (Severity: 5) Expression form of "eval" at line 7784, column 4. See page 161 of PBP. (Severity: 5) Expression form of "eval" at line 7806, column 4. See page 161 of PBP. (Severity: 5) Glob written as <...> at line 8016, column 25. See page 167 of PBP. (Severity: 5) "return" statement followed by "sort" at line 9195, column 60. Behavior is undefined if called in scalar context. (Severity: 5) Expression form of "eval" at line 9846, column 10. See page 161 of PBP. (Severity: 5)
-
Marko Mäkelä authored
buf_read_page_low(): Remove an error message and a debug assertion that can be triggered when using innodb_page_size=4k and innodb_file_per_table=0. In that case, buf_read_ahead_linear() may be invoked on page 255, which is one less than the first page of the doublewrite buffer (256).
-
Marko Mäkelä authored
fil_space_t::flush_freed(): Renamed from buf_flush_freed_pages(); this is a backport of aa458506 from 10.6. Invoke log_write_up_to() on last_freed_lsn, instead of avoiding the operation when the log has not yet been written. A more costly alternative would be that log_checkpoint() would invoke this function on every affected tablespace.
-
- 11 May, 2023 6 commits
-
-
Marko Mäkelä authored
-
Marko Mäkelä authored
buf_read_ahead_linear(): Correct some calculations that were broken in commit b1ab211d (MDEV-15053). Thanks to Daniel Black for providing a test case and initial debugging. Tested by: Matthias Leich
-
Marko Mäkelä authored
-
Marko Mäkelä authored
btr_cur_need_opposite_intention(): Check also page_zip_available() so that we will escalate to exclusive index latch when a non-leaf page may have to be split further due to ROW_FORMAT=COMPRESSED page overflow. Tested by: Matthias Leich
-
Marko Mäkelä authored
best_access_path(): Simplify the logic for computing fanout. This fixes up commit 4329ec5d
-
Marko Mäkelä authored
-
- 10 May, 2023 2 commits
-
-
Daniel Bartholomew authored
-
Daniel Bartholomew authored
-
- 08 May, 2023 4 commits
-
-
Tuukka Pasanen authored
Command lsof can fail on Debian install. Revert logic more like old one to make sure that there is no failing and still does don't boundce on shellcheck.
-
Tuukka Pasanen authored
Debian install scripts if-clauses are not formatted as they should be. This commit formats Debian Pre and Post script if-clauses.
-
Tuukka Pasanen authored
Commit fixes several ShellCheck found problems in Debian Pre- and Postscripts. Debian script mariadb-server-10.6.postrm contains shellcheck Fixed problems are: https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2006 -- Use $(...) notation instead of le... https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf... Debian script mariadb-server-10.6.postinst contains shellcheck Fixed problems are: https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; } >>... https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf... https://www.shellcheck.net/wiki/SC1072 -- Expected test to end here (don't ... https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this test expressi... https://www.shellcheck.net/wiki/SC1009 -- The mentioned syntax error was in... Debian script mariadb-server-10.6.preinst contains shellcheck Fixed problems are: https://www.shellcheck.net/wiki/SC2231 -- Quote expansions in this for loop... https://www.shellcheck.net/wiki/SC2166 -- Prefer [ p ] && [ q ] as [ p -a q... https://www.shellcheck.net/wiki/SC2001 -- See if you can use ${variable//se... https://www.shellcheck.net/wiki/SC1091 -- Not following: /usr/share/debconf... https://www.shellcheck.net/wiki/SC1007 -- Remove space after = if trying to...
-
Tuukka Pasanen authored
There is several misindentation inside Debian post and pre installation scripts. False indentation with space as indent space should be 2 and indentation with tabs.
-
- 05 May, 2023 4 commits
-
-
Sergei Petrunia authored
Derived table creation code would call Field::make_new_field() which would memcpy the Field object from the source table, including Field::read_stats. But the temp. table as a whole had table->stats_is_read=false. Which was correct but not consistent with Field::read_stats and caused an assertion. Fixed by making sure that Field::read_stats=NULL for fields in the new temporary (i.e. work) tables.
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Sergei Petrunia authored
The problem, introduced in patch for MDEV-26301: When check_join_cache_usage() decides not to use join buffer, it must adjust the access method accordingly. For BNL-H joins this means switching from pseudo-"ref access"(with index=MAX_KEY) to some other access method. Failing to do this will cause assertions down the line when code that is not aware of BNL-H will try to initialize index use for ref access with index=MAX_KEY. The fix is to follow the regular code path to disable the join buffer for the join_tab ("goto no_join_cache") instead of just returning from check_join_cache_usage().
-
- 04 May, 2023 10 commits
-
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
Do not try to decide merge/materialize for derived if it was already decided (even if it is a view).
-
Sergei Golubchik authored
RocksDB (in a submodule) has to include <cstdint> to use uint64_t but it doesn't. Until the submodule is upgraded, let's replace problematic types with something that's available
-
Sergei Golubchik authored
select_insert::store_values() must reset has_value_set bitmap before every row, just like mysql_insert() does. because ON DUPLICATE KEY UPDATE and triggers modify it
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
Temporary fix to avoid the server crash.
-
Oleksandr Byelkin authored
-
Oleksandr Byelkin authored
-