1. 27 Jun, 2022 14 commits
  2. 24 Jun, 2022 1 commit
  3. 23 Jun, 2022 4 commits
  4. 22 Jun, 2022 3 commits
    • Marko Mäkelä's avatar
      MDEV-18976 fixup: encryption.innodb-redo-badkey · 0f0a45b2
      Marko Mäkelä authored
      When attempting to recover a database with an incorrect encryption key,
      the unencrypted page contents should be expected to differ from what
      was written before recovery. Let us suppress some more messages.
      This caused intermittent failures, depending on when the latest
      log checkpoint was triggered.
      0f0a45b2
    • Marko Mäkelä's avatar
      MDEV-22388 Corrupted undo log record leads to server crash · 6f4d0659
      Marko Mäkelä authored
      trx_undo_rec_copy(): Return nullptr if the undo record is corrupted.
      
      trx_undo_rec_get_undo_no(): Define inline with the declaration.
      
      trx_purge_dummy_rec: Replaced with a -1 pointer.
      
      row_undo_rec_get(), UndorecApplier::apply_undo_rec(): Check
      if trx_undo_rec_copy() returned nullptr.
      
      trx_purge_get_next_rec(): Return nullptr upon encountering any
      corruption, to signal the end of purge.
      6f4d0659
    • Marko Mäkelä's avatar
      MDEV-28836 fixup · 0fa19fde
      Marko Mäkelä authored
      On GNU/Linux, even though the C11 aligned_alloc() appeared in
      GNU libc early on, some custom memory allocators did not
      implement it until recently. For example, before
      gperftools/gperftools@d406f2285390c402e824dd28e6992f7f890dcdf9
      the free() in tcmalloc would fail to free memory that was
      returned by aligned_alloc(), because the latter would map to the
      built-in allocator of libc. The Linux specific memalign() has a
      similar interface and is safer to use, because it has been
      available for a longer time. For AddressSanitizer, we will use
      aligned_alloc() so that the constraint on size can be enforced.
      
      buf_tmp_reserve_compression_buf(): When HAVE_ALIGNED_ALLOC holds,
      round up the size to be an integer multiple of the alignment.
      
      pfs_malloc(): In the unit test stub, round up the size to be an
      integer multiple of the alignment.
      0fa19fde
  5. 21 Jun, 2022 6 commits
    • Marko Mäkelä's avatar
      MDEV-28836: Memory alignment cleanup · 37946731
      Marko Mäkelä authored
      Table_cache_instance: Define the structure aligned at
      the CPU cache line, and remove a pad[] data member.
      Krunal Bauskar reported this to improve performance on ARMv8.
      
      aligned_malloc(): Wrapper for the Microsoft _aligned_malloc()
      and the ISO/IEC 9899:2011 <stdlib.h> aligned_alloc().
      Note: The parameters are in the Microsoft order (size, alignment),
      opposite of aligned_alloc(alignment, size).
      Note: The standard defines that size must be an integer multiple
      of alignment. It is enforced by AddressSanitizer but not by GNU libc
      on Linux.
      
      aligned_free(): Wrapper for the Microsoft _aligned_free() and
      the standard free().
      
      HAVE_ALIGNED_ALLOC: A new test. Unfortunately, support for
      aligned_alloc() may still be missing on some platforms.
      We will fall back to posix_memalign() for those cases.
      
      HAVE_MEMALIGN: Remove, along with any use of the nonstandard memalign().
      
      PFS_ALIGNEMENT (sic): Removed; we will use CPU_LEVEL1_DCACHE_LINESIZE.
      
      PFS_ALIGNED: Defined using the C++11 keyword alignas.
      
      buf_pool_t::page_hash_table::create(),
      lock_sys_t::hash_table::create():
      lock_sys_t::hash_table::resize(): Pad the allocation size to an
      integer multiple of the alignment.
      
      Reviewed by: Vladislav Vaintroub
      37946731
    • Marko Mäkelä's avatar
      MDEV-28870 InnoDB: Missing FILE_CREATE, FILE_DELETE or FILE_MODIFY before FILE_CHECKPOINT · 2e43af69
      Marko Mäkelä authored
      There was a race condition between log_checkpoint_low() and
      deleting or renaming data files. The scenario is as follows:
      
      1. The buffer pool does not contain dirty pages.
      2. A FILE_DELETE or FILE_RENAME record is written.
      3. The checkpoint LSN will be moved ahead of the write of the record.
      4. The server is killed before the file is actually renamed or deleted.
      
      We will prevent this race condition by ensuring that a log checkpoint
      cannot occur between the durable write and the file system operation:
      
      1. Durably write the FILE_DELETE or FILE_RENAME record.
      2. Perform the file system operation.
      3. Allow any log checkpoint to proceed.
      
      mtr_t::commit_file(): Implement the DELETE or RENAME logic.
      
      fil_delete_tablespace(): Delegate some of the logic to
      mtr_t::commit_file().
      
      fil_space_t::rename(): Delegate some logic to mtr_t::commit_file().
      Remove the debug injection point fil_rename_tablespace_failure_2
      because we do test RENAME failures without any debug injection.
      
      fil_name_write_rename_low(), fil_name_write_rename(): Remove.
      
      Tested by Matthias Leich
      2e43af69
    • Julius Goryavsky's avatar
      MDEV-26562: galera-sst-mariabackup is failing due to missing xtrabackup_checkpoints · 3e09c619
      Julius Goryavsky authored
      This commit contains workaround for a bug known as 'Red Hat issue 1870279'
      (connection reset by peer issue in socat versions 1.7.3.3 to 1.7.4.0) which
      further causes crashes during SST using mariabackup (when openssl is used).
      
      Also fixed broken logic of automatic generation of the Diffie-Hellman parameters
      for socat version less than 1.7.3 (which defaults to 512-bit values instead of
      2048-bit ones).
      3e09c619
    • Marko Mäkelä's avatar
      MDEV-28845 fixup: Prevent an infinite loop · 55f02c24
      Marko Mäkelä authored
      buf_page_create_low(): Before retrying, release the exclusive page latch
      in order to prevent an infinite loop in buf_pool_t::corrupted_evict().
      55f02c24
    • Marko Mäkelä's avatar
      MDEV-28782 fixup: ./mtr --embedded · 3b662c6e
      Marko Mäkelä authored
      3b662c6e
    • Julius Goryavsky's avatar
  6. 20 Jun, 2022 1 commit
  7. 18 Jun, 2022 2 commits
    • Daniel Black's avatar
      MDEV-28884: include kernel information in crashing signal handler · d4539426
      Daniel Black authored
      Recent adventures in liburing and btrfs have shown up some kernel
      version dependent bugs. Having a bug report of accurace kernel version
      can start to correlate these errors sooner.
      
      On Linux, /proc/version contains the kernel version.
      
      FreeBSD has kern.version (per man 8 sysctl), so include that too.
      
      Example output:
      
      Max nice priority         0                    0
      Max realtime priority     0                    0
      Max realtime timeout      unlimited            unlimited            us
      Core pattern: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h
      
      Kernel version: Linux version 5.19.0-0.rc2.21.fc37.x86_64 (mockbuild@bkernel01.iad2.fedoraproject.org) (gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1), GNU ld version 2.38-14.fc37) #1 SMP PREEMPT_DYNAMIC Mon Jun 13 15:27:24 UTC 2022
      
      Segmentation fault (core dumped)
      d4539426
    • Sergei Golubchik's avatar
      remove invalid test · f299351e
      Sergei Golubchik authored
      it starts an EXPLAIN of a multi-table join and tries to KILL it.
      no sync points.
      depending on how fast the hareware is and optimizer development
      it might kill EXPLAIN at some random point in time (generally unrelated
      to the Bug#28598 it was supposed to test) or EXPLAIN might finish
      before the KILL and the test will fail.
      f299351e
  8. 17 Jun, 2022 3 commits
  9. 16 Jun, 2022 3 commits
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 5bb90cb2
      Marko Mäkelä authored
      5bb90cb2
    • Marko Mäkelä's avatar
      MDEV-28864 Assertion `trx_id <= create_id' failed in innodb_check_version() · e99ba4ac
      Marko Mäkelä authored
      ha_innobase::prepare_inplace_alter_table(): If the ALTER TABLE
      operation is no-op for InnoDB, do reset m_prebuilt->trx_id
      so that ha_innobase::table_version() will always report either 0
      or the identifier of the transaction that would commit changes
      to the InnoDB data dictionary.
      
      The failure scenario involved a completed DROP INDEX followed by
      a no-op ALTER TABLE during which the server was killed.
      An effort to create a reproducible test failed.
      e99ba4ac
    • Shunsuke Tokunaga's avatar
      MDEV-21027 Assertion `part_share->auto_inc_initialized ||... · c4f65d8f
      Shunsuke Tokunaga authored
      MDEV-21027 Assertion `part_share->auto_inc_initialized || !can_use_for_auto_inc_init()' failed in ha_partition::set_auto_increment_if_higher
      
      ha_partition::set_auto_increment_if_higher expects
      part_share->auto_inc_initialized is true or can_use_for_auto_inc_init()
      is false (but as the comment of this method says, it returns false
      only if we use Spider engine with DROP TABLE or ALTER TABLE query).
      However, part_share->auto_inc_initialized becomes true only after all
      partitions are opened (since 6dce6aec).
      
      Therefore, I added a conditional expression in order to read all
      partitions when we execute REPLACE on a table that has an
      AUTO_INCREMENT column.           
      
      Reviewed by: Nayuta Yanagisawa
      Reviewed by: Alexey Botchkov
      c4f65d8f
  10. 15 Jun, 2022 3 commits
    • Monty's avatar
      MDEV-28858 Wrong result with table elimination combined with not_null_range_scan · 674842be
      Monty authored
      The bug was that build_notnull_conds_for_range_scans() did not take into
      account the join_tab is not yet sorted with constant tables first.
      Fixed the bug by testing explicitely if a table is a const table.
      674842be
    • Marko Mäkelä's avatar
      MDEV-28845 InnoDB: Failing assertion: bpage->can_relocate() in buf0lru.cc · 253806df
      Marko Mäkelä authored
      Since commit 0b47c126 (MDEV-13542)
      we treat all-zero pages as corrupted ones.
      
      During a stress test, a read-ahead of an all-zero page was triggered
      and the page read was completed concurrently with buf_page_create_low().
      This caused the assertion to fail, because buf_page_create_low() was
      waiting for the page latch.
      
      buf_page_get_low(): Only invoke buf_pool_t::corrupted_evict()
      if the block was not already marked as corrupted.
      
      buf_page_create_low(): On page identifier mismatch, retry the
      buf_pool.page_hash lookup.
      
      buf_pool_t::corrupted_evict(): Set the state of the block to FREED
      so that a concurrent buf_page_get_low() will refuse to load the page.
      Wait for the page latch to be vacant before proceeding to remove
      the block from buf_pool.page_hash and buf_pool.LRU.
      
      page_id_t::set_corrupted(), page_id_t::is_corrupted(): Accessors
      for indicating a corrupted page identifier.
      
      Tested by Matthias Leich
      253806df
    • Sergei Golubchik's avatar
      mtr: fix a race condition · f31e935c
      Sergei Golubchik authored
      if a test can run in cond1,cond2 and cond1,cond3 then they can happen
      to run in parallel and both wanting to create test,cond1.result~
      f31e935c