1. 16 Nov, 2022 2 commits
  2. 14 Nov, 2022 8 commits
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · ae6ebafd
      Marko Mäkelä authored
      ae6ebafd
    • Marko Mäkelä's avatar
      MDEV-29984 innodb_fast_shutdown=0 fails to report change buffer merge progress · dc2741be
      Marko Mäkelä authored
      ibuf.size, ibuf.max_size: Changed the type to Atomic_relaxed<ulint>
      in order to fix some (not all) race conditions.
      
      ibuf_contract(): Renamed from ibuf_merge_pages(ulint*).
      
      ibuf_merge(), ibuf_merge_all(): Removed.
      
      srv_shutdown(): Invoke log_free_check() and ibuf_contract(). Even though
      ibuf_contract() is not writing anything, it will trigger calls of
      ibuf_merge_or_delete_for_page(), which will write something. Because
      we cannot invoke log_free_check() at that low level, we must invoke
      it at the high level.
      
      srv_shutdown_print(): Replaces srv_shutdown_print_master_pending().
      Report progress and remaining work every 15 seconds. For the
      change buffer merge, the remaining work is indicated by ibuf.size.
      dc2741be
    • Marko Mäkelä's avatar
      Cleanup: Remove a useless header file · 744b33c2
      Marko Mäkelä authored
      744b33c2
    • Marko Mäkelä's avatar
      MDEV-16264 fixup: Remove unused variables · ee7fba17
      Marko Mäkelä authored
      ee7fba17
    • Marko Mäkelä's avatar
      MDEV-29978 Corruption errors upon CHECK on temporary InnoDB table · c82f3f1b
      Marko Mäkelä authored
      row_check_index(): Treat secondary indexes of temporary tables as if
      SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
      is in effect. That is, only consider the delete-mark and nothing else.
      c82f3f1b
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-29987 Bogus errors about file size in the test mariabackup.defer_space · 704c74cd
      Thirunarayanan Balathandayuthapani authored
      - Changed the page0 perl corruption code in test case to avoid
      the bogus error in windows
      704c74cd
    • Marko Mäkelä's avatar
      MDEV-29982 Improve the InnoDB log overwrite error message · e0e096fa
      Marko Mäkelä authored
      The InnoDB write-ahead log ib_logfile0 is of fixed size,
      specified by innodb_log_file_size. If the tail of the log
      manages to overwrite the head (latest checkpoint) of the log,
      crash recovery will be broken.
      
      Let us clarify the messages about this, including adding
      a message on the completion of a log checkpoint that notes
      that the dangerous situation is over.
      
      To reproduce the dangerous scenario, we will introduce the
      debug injection label ib_log_checkpoint_avoid_hard, which will
      avoid log checkpoints even harder than the previous
      ib_log_checkpoint_avoid.
      
      log_t::overwrite_warned: The first known dangerous log sequence number.
      Set in log_close() and cleared in log_write_checkpoint_info(),
      which will output a "Crash recovery was broken" message.
      e0e096fa
    • Marko Mäkelä's avatar
      MDEV-29905 fixup: Remove some unnecessary code · 2283f82d
      Marko Mäkelä authored
      srv_shutdown(): Do not call log_free_check(), because it will now
      be repeatedly called by ibuf_merge_all(). Do not call
      srv_sync_log_buffer_in_background(), because we do not actually care
      about durability during shutdown. Log writes will already be triggered
      by buf_flush_page_cleaner() for writing back modified pages, possibly by
      log_free_check().
      
      logs_empty_and_mark_files_at_shutdown(): Clean up a condition.
      This function is the caller of srv_shutdown(), and it will ensure that
      the log and the buffer pool will be in clean state before shutdown.
      2283f82d
  3. 13 Nov, 2022 1 commit
  4. 11 Nov, 2022 2 commits
    • Alexander Barkov's avatar
      MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... · 505da21e
      Alexander Barkov authored
      This bug was previously fixed in 10.6.11 by:
         MDEV-28327 InnoDB persistent statistics fail to update after bulk insert
      
      Adding MTR tests only.
      
      Also, fixing the old test for MDEV-28327 to make "mtr" reliably pass
      with/without --mysqld=--innodb-stats-persistent=0, and with different page sizes,
      as suggested by Marko.
      505da21e
    • Otto Kekäläinen's avatar
      Misc Debian/Salsa-CI fixes (#2299) · f4adf354
      Otto Kekäläinen authored
      * Deb: Handle codename 'n/a' from Debian Sid properly and autobake-deb cleanup
      
      This fixes autobake-deb.sh builds on Sid which was visible as 4 failing
      build steps on Salsa-CI.
      
      - In Sid the LSBNAME might evaluate to 'n/a', so accept it as 'Sid' to
        fix builds that failed with error:
      
          Error - unknown release codename n/a
      
      - Refactor list to have Ubuntu versions first, then Debian, and as last
        the special case of Debian Sid
      
      - Fix minor syntax issues detected by Shellcheck
      
      Also remove useless DEB_HOST_ARCH_CPU check from debian/rules:
      * It was never in effect as the 'sed' in autobake-deb.sh cleared it anyway
      * The variable name was wrong and always empty
      * If variable would have been correct, logic was still reversed
      
      - Define 3h timeout as the default 1h timeout on Gitlab.com (and others)
        is usually not enough for initial (uncached) MariaDB builds.
      
      - Replace Buster to Bookworm/Sid upgrade testing with upgrade inside Buster
        testing as direct upgrades from Stretch to Bullseye and Buster to Bookworm
        are no longer possible due to:
      
          Bug#993755: libcrypt.so.1: cannot open shared object file when
          upgrading from Stretch to Sid (https://bugs.debian.org/993755)
      
      - Stop ignoring MariaDB.org 10.6 to this version upgrade testing failures
        to reveal bug MDEV-28640. Originally this step was failing as the uring
        dependencies in upstream builders lagged behind and there was nothing
        that needed work, only time time to resolve. Now there is an actual bug
        in packaging that should be visible as a CI failure.
      
      - Stop testing for 'service mysql status' on systems that upgraded from
        MySQL 8.0 to MariaDB.org vended 10.6. Due to some unidentified debian/control
        changes in 10.6 on upstream the upgrade is no longer compatible in
        a way that would maintain the init.d script with name 'mysql'.
      
      - Fix typos where mergers had changed occurrences of 10.5 to 10.6 while
        they intentionally need to be exactly 10.5, otherwise the meaning
        changes.
      
      - Align autopkgtest code with downstream official Debian packaging one.
        This is change is safe on a stable branch because is only affects builds
        and testing, not any actual usage of MariaDB 10.6.
      
      - Standardize on using capitalized 'YES' in CMake build options
        (instead of 'yes' or mixed case)
      
      - Add some comments to better document debian/rules
      
      - Fix typo in Lintian overrides
      
      Ubuntu bug: https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634
      MariaDB ticket: https://jira.mariadb.org/browse/MDEV-25633
      
      When built with LTO on Ubuntu, MariaDB does not catch an exception when
      the uring initialization fails due to a low RLIMIT_MEMLOCK value.
      
      This commit amends the commit 0609b345
      to be identical to the one done downstream in Debian:
      https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179
      
      This way both the inline comments and 'git blame' for this section will
      show properly why this is needed, and the fix is one that is fully tested
      on Debian and Ubuntu.
      
      Also having this section fully identical in upstream MariaDB and downstream
      Debian will make the packaging maintenance easier as 'diff` runs on this
      file will not flag this as a difference anymore.
      
      In MDEV-28640 the init script failed to stop/start the MariaDB server
      due to missing mysqladmin on the system. This was however very hard to
      spot from the console output.
      
      Add an explicit check for the binary the script depends on, and fail
      verbosely if the dependency is missing.
      f4adf354
  5. 10 Nov, 2022 5 commits
  6. 09 Nov, 2022 8 commits
  7. 08 Nov, 2022 14 commits
    • Marko Mäkelä's avatar
      MDEV-22512: Re-enable the tests on 10.5 · b955f4ef
      Marko Mäkelä authored
      b955f4ef
    • Andrew Hutchings's avatar
      MDEV-29397 CONNECT engine: Fix note turning into error (#2325) · fda58467
      Andrew Hutchings authored
      * MDEV-29397 Fix note turning into error
      
      ODBC Rewind triggered an error with no SQL, but this is sometimes a
      valid condition (as can be seen with other classes). Setting this to a 0
      return stops errors firing when they shouldn't.
      
      Also fixes ASAN hits from in MDEV-29687 tabext.cpp.
      fda58467
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 2ac1edb1
      Marko Mäkelä authored
      2ac1edb1
    • Marko Mäkelä's avatar
      MDEV-29504/MDEV-29849 TRUNCATE breaks FOREIGN KEY locking · e572c745
      Marko Mäkelä authored
      ha_innobase::referenced_by_foreign_key(): Protect the check with
      dict_sys.freeze(), to prevent races with TRUNCATE TABLE.
      The test innodb.instant_alter_crash has been adjusted for this
      additional locking.
      
      dict_table_is_referenced_by_foreign_key(): Removed (merged to
      the only caller).
      
      create_table_info_t::create_table(): Ignore missing indexes for
      FOREIGN KEY constraints if foreign_key_checks=0.
      
      create_table_info_t::create_table_update_dict(): Rewritten as
      a static function. Do not return any error.
      
      ha_innobase::create(): When trx!=nullptr and we are operating
      on a persistent table, do not rollback, commit, or release the
      data dictionary latch.
      
      ha_innobase::truncate(): Protect the entire critical section
      with an exclusive dict_sys.latch, so that
      ha_innobase::referenced_by_foreign_key() on referenced tables
      will return a consistent result. In case of a failure,
      invoke dict_load_foreigns() to restore also any FOREIGN KEY
      constraints.
      
      ha_innobase::free_foreign_key_create_info(): Define inline.
      
      lock_release(): Disregard innodb_evict_tables_on_commit_debug=ON
      when dict_sys.locked() holds. It would hold when fts_load_stopword()
      is invoked by create_table_info_t::create_table_update_dict().
      
      dict_sys_t::locked(): Return whether the current thread is holding
      the exclusive dict_sys.latch.
      
      dict_sys_t::frozen_not_locked(): Return whether any thread is
      holding a shared dict_sys.latch.
      
      In the test main.mysql_upgrade, the InnoDB persistent statistics
      will no longer be recalculated in ha_innobase::open() as part of
      CHECK TABLE ... FOR UPGRADE. They were deleted earlier in the test.
      
      Tested by: Matthias Leich
      e572c745
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · a732d5e2
      Marko Mäkelä authored
      a732d5e2
    • Marko Mäkelä's avatar
      8fb176c3
    • Marko Mäkelä's avatar
      Work around MDEV-24813 in main.rowid_filter_innodb_debug · 12f20c15
      Marko Mäkelä authored
      Let us avoid excessive allocation of explicit record locks.
      12f20c15
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 93b4f84a
      Marko Mäkelä authored
      93b4f84a
    • Marko Mäkelä's avatar
      MDEV-29856 heap-use-after-poison in row_merge_spatial_rows() w/ column prefix · 2ef2e232
      Marko Mäkelä authored
      spatial_index_info: Replaces index_tuple_info_t. Always take
      a memory heap as a parameter to the member functions.
      Remove pointer indirection for m_dtuple_vec.
      
      spatial_index_info::add(): Duplicate any PRIMARY KEY fields that would
      point to within ext->buf because that buffer will be allocated in
      a shorter-lifetime memory heap.
      2ef2e232
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-28797 Assertion `page_rec_is_user_rec(rec)' failed in PageBulk::getSplitRec · f4519fb7
      Thirunarayanan Balathandayuthapani authored
      - During alter operation of compressed table, page split operation
      chooses the first record of the page as split record and it leads
      to empty left page. This issue caused by the commit 77b3959b (MDEV-28457).
      
      page_rec_is_second(), page_rec_is_second_last(): Removed the functions
      since it is a deadcode.
      f4519fb7
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-29853 Assertion `!strstr(table->name.m_name, "/FTS_") ||... · db85d8b0
      Thirunarayanan Balathandayuthapani authored
      MDEV-29853  Assertion `!strstr(table->name.m_name, "/FTS_") || purge_sys.must_wait_FTS()' failed in trx_t::commit
      
        - Failing debug assertion is to indicate whether the purge thread
      is waiting when fts auxilary table is being dropped. But assertion
      fails if the table name contains FTS_. So in fts_drop_table(), InnoDB
      sets the auxilary table flag in transaction modified table list.
      db85d8b0
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-29518 ASAN Failure on i_s query when tablespace does rename operation · 689e9512
      Thirunarayanan Balathandayuthapani authored
      - InnoDB information schema query access the tablespace name after
      getting freed by concurrent rename operation. To avoid this, InnoDB
      should take exclusive tablespace latch during rename operation
      and I_S query should take shared tablespace latch before accessing
      the name
      689e9512
    • Marko Mäkelä's avatar
      MDEV-29905 Change buffer operations fail to check for log file overflow · b737d09d
      Marko Mäkelä authored
      Every operation that is going to write redo log is supposed to
      invoke log_free_check() before acquiring any latches. If there
      is a risk of log buffer overrun, a log checkpoint would be
      triggered by that call.
      
      ibuf_merge_space(), ibuf_merge_in_background(),
      ibuf_delete_for_discarded_space(): Invoke log_free_check()
      when the current thread is not holding any page latches.
      
      Unfortunately, in lower-level code called from ibuf_insert()
      or ibuf_merge_or_delete_for_page(), some page latches may be
      held and a call to log_free_check() could hang.
      
      ibuf_set_bitmap_for_bulk_load(): Use the caller's mini-transaction.
      The caller should have invoked log_free_check() while not holding
      any page latches.
      b737d09d
    • Marko Mäkelä's avatar
      MDEV-23371: Crash in _db_doprnt_ via que_thr_step() · 49a0ad69
      Marko Mäkelä authored
      Something appears to be broken in the DBUG subsystem.
      Let us remove frequent calls to it from the InnoDB internal SQL interpreter
      that is used in the purge of transaction history.
      
      The DBUG_PRINT in que_eval_sql() can remain for now, because those
      operations are much less frequent.
      49a0ad69