1. 14 Jan, 2022 2 commits
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 16b87f98
      Marko Mäkelä authored
      16b87f98
    • Marko Mäkelä's avatar
      MDEV-27500 buf_page_free() fails to drop the adaptive hash index · c104a01b
      Marko Mäkelä authored
      The function buf_page_free() that was introduced
      in commit a35b4ae8 (MDEV-15528)
      failed to remove any adaptive hash index entries for the page
      before freeing the page.
      
      This caused an assertion failure on shutdown of 10.6 server of
      in the function buf_pool_t::clear_hash_index() with the expression:
      (s >= buf_page_t::UNFIXED || s == buf_page_t::REMOVE_HASH).
      The assertion would fail for a block that is in the freed state.
      
      The failing assertion was added in
      commit aaef2e1d
      in the 10.6 branch.
      
      Thanks to Matthias Leich for finding the bug and testing the fix.
      c104a01b
  2. 13 Jan, 2022 1 commit
    • Marko Mäkelä's avatar
      MDEV-27058 fixup: Bogus assertion !block->page.is_io_fixed() · e6a06113
      Marko Mäkelä authored
      buf_page_get_gen(): After recv_sys_t::recover_low() returned,
      the page must not be read-fixed, but it may be write-fixed,
      because the io-fix state is protected by block->page.lock,
      which we are not holding yet.
      
      Also, let us copy the block descriptor state to a local variable
      for examination, so that in case an assertion would fail again,
      we will have the sampled state in the core dump. In a core dump of
      the assertion failure, we had block->page.fix() == buf_page_t::UNFIXED,
      that is, the assertion expression was holding again.
      e6a06113
  3. 12 Jan, 2022 4 commits
  4. 11 Jan, 2022 1 commit
    • Eugene Kosov's avatar
      MDEV-27022 Buffer pool is being flushed during recovery · f443cd11
      Eugene Kosov authored
      The problem was introduced by the removal of buf_pool.flush_rbt
      in commit 46b1f500 (MDEV-23399)
      
      recv_sys_t::apply(): don't write to disc and fsync() the last batch.
      Insead, sort it by oldest_modification for MariaDB server and some
      mariabackup operations.
      
      log_sort_flush_list(): a thread-safe function which sorts buf_pool::flush_list
      f443cd11
  5. 10 Jan, 2022 3 commits
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-27640 trx_has_lock_x() gives wrong result if the table has pending table lock · 428b057e
      Thirunarayanan Balathandayuthapani authored
      trx_has_lock_x() fails to find whether the trx has X-lock on the table
      when other transactions are waiting for an X or S lock on the table.
      428b057e
    • Marko Mäkelä's avatar
      Cleanup: Remove unused log_cmdq_key · fcbd3989
      Marko Mäkelä authored
      There was an intention to add a CommandQueue in
      mysql/mysql-server@eca5b0fc17a5bd6d4833d35a0d08c8549dd3b5ec
      but it never appeared in any release (not even MySQL 5.7.3
      where that commit appeared).
      fcbd3989
    • Rucha Deodhar's avatar
      MDEV-23836: Assertion `! is_set() || m_can_overwrite_status' in · 81e00485
      Rucha Deodhar authored
      Diagnostics_area::set_error_status (interrupted ALTER TABLE under LOCK)
      
      Analysis: KILL_QUERY is not ignored when local memory used exceeds maximum
      session memory. Hence the query proceeds, OK is sent and we end up
      reopening tables that are marked for reopen. During this, kill status is
      eventually checked and assertion failure happens during trying to send error
      message because OK has already been sent.
      Fix: Ok is already sent so statement has already executed. It is too
      late to give error. So ignore kill.
      81e00485
  6. 09 Jan, 2022 2 commits
  7. 05 Jan, 2022 5 commits
  8. 04 Jan, 2022 3 commits
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 3f572676
      Marko Mäkelä authored
      3f572676
    • Marko Mäkelä's avatar
      MDEV-27416 InnoDB hang in buf_flush_wait_flushed(), on log checkpoint · 4c3ad244
      Marko Mäkelä authored
      InnoDB could sometimes hang when triggering a log checkpoint. This is
      due to commit 7b1252c0 (MDEV-24278),
      which introduced an untimed wait to buf_flush_page_cleaner().
      
      The hang was noticed by occasional failures of IMPORT TABLESPACE tests,
      such as innodb.innodb-wl5522, which would (unnecessarily) invoke
      log_make_checkpoint() from row_import_cleanup().
      
      The reason of the hang was that buf_flush_page_cleaner() would enter
      untimed sleep despite buf_flush_sync_lsn being set. The exact failure
      scenario is unclear, because buf_flush_sync_lsn should actually be
      protected by buf_pool.flush_list_mutex. We prevent the hang by
      invoking buf_pool.page_cleaner_set_idle(false) whenever we are
      setting buf_flush_sync_lsn and signaling buf_pool.do_flush_list.
      
      The bulk of these changes was originally developed as a preparation
      for MDEV-26827, to invoke buf_flush_list() from fewer threads,
      and tested on 10.6 by Matthias Leich.
      
      This fix was tested by running 100 repetitions of 100 concurrent instances
      of the test innodb.innodb-wl5522 on a RelWithDebInfo build, using ext4fs
      and innodb_flush_method=O_DIRECT on a SATA SSD with 4096-byte block size.
      During the test, the call to log_make_checkpoint() in row_import_cleanup()
      was present.
      
      buf_flush_list(): Make static.
      
      buf_flush_wait(): Wait for buf_pool.get_oldest_modification()
      to reach a target, by work done in the buf_flush_page_cleaner.
      If buf_flush_sync_lsn is going to be set, we will invoke
      buf_pool.page_cleaner_set_idle(false).
      
      buf_flush_ahead(): If buf_flush_sync_lsn or buf_flush_async_lsn
      is going to be set and the page cleaner woken up, we will invoke
      buf_pool.page_cleaner_set_idle(false).
      
      buf_flush_wait_flushed(): Invoke buf_flush_wait().
      
      buf_flush_sync(): Invoke recv_sys.apply() at the start in case
      crash recovery is active. Invoke buf_flush_wait().
      
      buf_flush_sync_batch(): A lower-level variant of buf_flush_sync()
      that is only called by recv_sys_t::apply().
      
      buf_flush_sync_for_checkpoint(): Do not trigger log apply
      or checkpoint during recovery.
      
      buf_dblwr_t::create(): Only initiate a buffer pool flush, not
      a checkpoint.
      
      row_import_cleanup(): Do not unnecessarily invoke log_make_checkpoint().
      Invoking buf_flush_list_space() before starting to generate redo log
      for the imported tablespace should suffice.
      
      srv_prepare_to_delete_redo_log_file():
      Set recv_sys.recovery_on in order to prevent
      buf_flush_sync_for_checkpoint() from initiating a checkpoint
      while the log is inaccessible. Remove a wait loop that is already
      part of buf_flush_sync().
      Do not invoke fil_names_clear() if the log is being upgraded,
      because the FILE_MODIFY record is specific to the latest format.
      
      create_log_file(): Clear recv_sys.recovery_on only after calling
      log_make_checkpoint(), to prevent buf_flush_page_cleaner from
      invoking a checkpoint.
      
      innodb_shutdown(): Simplify the logic in mariadb-backup --prepare.
      
      os_aio_wait_until_no_pending_writes(): Update the function comment.
      Apart from row_quiesce_table_start() during FLUSH TABLES...FOR EXPORT,
      this is being called by buf_flush_list_space(), which is invoked
      by ALTER TABLE...IMPORT TABLESPACE as well as some encryption operations.
      4c3ad244
  9. 03 Jan, 2022 6 commits
  10. 31 Dec, 2021 1 commit
  11. 28 Dec, 2021 1 commit
  12. 27 Dec, 2021 2 commits
  13. 26 Dec, 2021 1 commit
  14. 25 Dec, 2021 1 commit
  15. 24 Dec, 2021 1 commit
  16. 23 Dec, 2021 6 commits
    • Nayuta Yanagisawa's avatar
      MDEV-27184 Assertion `(old_top == initial_top (av) && old_size == 0) ||... · dc74d234
      Nayuta Yanagisawa authored
      MDEV-27184 Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed, Assertion `str.alloced_length() >= str.length() + data_len' failed
      
      Spider crashes on a query that inserts some rows including float.
      This is because Spider allocates a string of insufficient length.
      dc74d234
    • Julius Goryavsky's avatar
      MDEV-24097: galera[_3nodes] suite tests in MTR sporadically fails · b5cbe506
      Julius Goryavsky authored
      This is the first part of the fixes for MDEV-24097. This commit
      contains the fixes for instability when testing Galera and when
      restarting nodes quickly:
      
      1) Protection against a "stuck" old SST process during the execution
         of the new SST (after restarting the node) is now implemented for
         mariabackup / xtrabackup, which should help to avoid almost all
         conflicts due to the use of the same ports - both during testing
         with mtr, so and when restarting nodes quickly in a production
         environment.
      2) Added more protection to scripts against unexpected return of
         the rc != 0 (in the commands for deleting temporary files, etc).
      3) Added protection against unexpected crashes during binlog transfer
         (in SST scripts for rsync).
      4) Spaces and some special characters in binlog filenames shouldn't
         be a problem now (at the script level).
      5) Daemon process termination tracking has been made more robust
         against crashes due to unexpected termination of the previous SST
         process while new scripts are running.
      6) Reading ssl encryption parameters has been moved from specific
         SST scripts to a common wsrep_sst_common.sh script, which allows
         unified error handling, unified diagnostics and simplifies script
         revisions in the future.
      7) Improved diagnostics of errors related to the use of openssl.
      8) Corrections have been made for xtrabackup-v2 (both in tests and in
         the script code) that restore the work of xtrabackup with updated
         versions of innodb.
      9) Fixed some tests for galera_3nodes, although the complete solution
         for the problem of starting three nodes at the same time on fast
         machines will be done in a separate commit.
      
      No additional tests are required as this commit fixes problems with
      existing tests.
      b5cbe506
    • Julius Goryavsky's avatar
      Merge branch 10.2 into 10.3 · 3376668c
      Julius Goryavsky authored
      3376668c
    • Sergei Petrunia's avatar
      Fix typos in optimizer trace output · 4b020bfd
      Sergei Petrunia authored
      4b020bfd
    • Sergei Petrunia's avatar
      MDEV-27238: Assertion `got_name == named_item_expected()' failed in Json_writer · 397f5cf7
      Sergei Petrunia authored
      make_join_select() calls const_cond->val_int(). There are edge cases
      where const_cond may have a not-yet optimized subquery.
      
      (The subquery will have used_tables() covered by join->const_tables. It
      will still have const_item()==false, so other parts of the optimizer
      will not try to evaluate it.  We should probably mark such subqueries
      as constant but that is outside the scope of this MDEV)
      397f5cf7
    • Leandro Pacheco's avatar
      result of wsrep logic in queue_for_group_commit was being ignored · 0165a063
      Leandro Pacheco authored
      This could cause out of order wsrep checkpoints due wsrep specific leader
      code not being executed in `MYSQL_BIN_LOG::write_transaction_to_binlog_events`.
      Move original result assignment to before wsrep logic to prevent that.
      Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
      0165a063