1. 17 Mar, 2022 2 commits
    • Marko Mäkelä's avatar
      MDEV-28111 Redo log writes are being buffered on Linux for no good reason · c4c88307
      Marko Mäkelä authored
      In commit 685d958e (MDEV-14425)
      we ended up not enabling O_DIRECT writes on the redo log
      by default, because back then, it was slightly slower on
      some systems.
      
      With commit a635c406 (MDEV-27774)
      the situation changed. A new test on a NVMe device shows 9%
      improvement in throughput and over 15% reduction of latency
      when O_DIRECT writes are enabled.
      
      With this change, all the following settings will use O_DIRECT
      on InnoDB data and log files:
      
      innodb_flush_method=O_DIRECT
      innodb_flush_method=O_DIRECT_NO_FSYNC
      innodb_flush_method=O_DSYNC
      
      Before MDEV-14425, log writes were always buffered on Linux.
      Between MDEV-14425 and this change, unbuffered log writes
      were only enabled for innodb_flush_method=O_DSYNC.
      c4c88307
    • Marko Mäkelä's avatar
      MDEV-28043 fixup: GCC -m32 -Wconversion · 86820837
      Marko Mäkelä authored
      86820837
  2. 16 Mar, 2022 1 commit
  3. 15 Mar, 2022 10 commits
    • Marko Mäkelä's avatar
      Merge 10.7 into 10.8 · 9f5a3e56
      Marko Mäkelä authored
      9f5a3e56
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.7 · dc4b7f38
      Marko Mäkelä authored
      dc4b7f38
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 4ef44cc2
      Marko Mäkelä authored
      4ef44cc2
    • Marko Mäkelä's avatar
      MDEV-27985 buf_flush_freed_pages() causes InnoDB to hang · 73fee39e
      Marko Mäkelä authored
      buf_flush_freed_pages(): Assert that neither buf_pool.mutex
      nor buf_pool.flush_list_mutex are held. Simplify the loops.
      Return the tablespace and the number of pages written or punched.
      
      buf_flush_LRU_list_batch(), buf_do_flush_list_batch():
      Release buf_pool.mutex before invoking buf_flush_space().
      
      buf_flush_list_space(): Acquire the mutexes only after invoking
      buf_flush_freed_pages().
      
      Reviewed by: Thirunarayanan Balathandayuthapani
      73fee39e
    • Marko Mäkelä's avatar
      Fix clang -Wtypedef-redefinition · de4ec44b
      Marko Mäkelä authored
      Include my_global.h before mysql.h so that the latter will not
      redefine my_socket and my_ulonglong.
      
      Fixup for commit 77c184df
      de4ec44b
    • Marko Mäkelä's avatar
      MDEV-28043 Race condition between mtr_t::commit() and checkpoint · 8575d2fb
      Marko Mäkelä authored
      In commit a635c406 (MDEV-27774)
      a race condition was introduced between mtr_t::commit() and
      a log checkpoint.
      
      Between the time of assigning the log sequence number and adding
      the changed pages to buf_pool.flush_list, the log_sys.latch must
      be continuously held by the current thread, or otherwise a
      log checkpoint could get the wrong result from
      buf_pool.get_oldest_modification().
      
      buf_pool_t::insert_into_flush_list(): Add a debug assertion for
      increasing the probability of cathing this type of problem.
      
      mtr_t::m_latch_ex: A flag that indicates whether the mini-transaction
      is holding log_sys.latch in exclusive mode.
      
      mtr_t::do_write(), mtr_t::finish_write(): Remove the parameter
      "bool ex" and refer to m_latch_ex instead.
      
      mtr_t::commit(): Release log_sys.latch according to m_latch_ex.
      
      mtr_t::commit_shrink(), mtr_t::commit_files(): Set m_latch_ex.
      
      mtr_t::do_write(): Do not release an exclusive log_sys.latch,
      but instead set m_latch_ex if needed.
      8575d2fb
    • Marko Mäkelä's avatar
      MDEV-25214 Crash in fil_space_t::try_to_close · 00896db1
      Marko Mäkelä authored
      fil_space_t::try_to_close(): Tolerate a tablespace that has no
      data files attached. The function fil_ibd_create() initially
      creates and attaches a tablespace with no files, and invokes
      fil_space_t::add() later.
      
      fil_node_open_file(): After releasing and reacquiring fil_system.mutex,
      check if the file was already opened by another thread. This avoids
      an assertion failure !node->is_open() in fil_node_open_file_low().
      
      These failures were reproduced with the test
      innodb.table_definition_cache_debug and the fix of MDEV-27985.
      00896db1
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · e1246775
      Marko Mäkelä authored
      e1246775
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 9c6135e8
      Marko Mäkelä authored
      9c6135e8
    • Hugo Wen's avatar
      MDEV-27342: Fix issue of recovery failure using new server id · dafc5fb9
      Hugo Wen authored
      Commit 6c39eaeb made the crash recovery dependent on server_id.
      The crash recovery could fail when restoring a new instance from
      original crashed data directory USING A NEW SERVER ID.
      
      The issue doesn't exist in previous major versions before 10.6.
      
      Root cause is when generating the input XID to be searched in the hash,
      server id is populated with the current server id.
      So if the server id changed when recovering, the XID couldn't be found
      in the hash due to server id doesn't match.
      
      This fix is to use original server id when creating the input XID
      object in function `xarecover_do_commit_or_rollback`.
      
      All new code of the whole pull request, including one or several files
      that are either new files or modified ones, are contributed under the
      BSD-new license. I am contributing on behalf of my employer Amazon Web
      Services, Inc.
      dafc5fb9
  4. 14 Mar, 2022 12 commits
  5. 12 Mar, 2022 4 commits
  6. 11 Mar, 2022 11 commits