1. 03 Jul, 2024 5 commits
    • Brandon Nesterenko's avatar
      MDEV-9159: Bring back assert in semisync_master.cc · d58975bb
      Brandon Nesterenko authored
      In 10.0 there was an assert to ensure that there were semi
      sync clients before removing one, but it was removed in 10.1.
      This patch adds the assertion back.
      d58975bb
    • mariadb-DebarunBanerjee's avatar
      MDEV-34458 wait_for_read in buf_page_get_low hurts performance · 73ad436e
      mariadb-DebarunBanerjee authored
      The performance regression seen while loading BP is caused by the
      deadlock fix given in MDEV-33543. The area of impact is wider but is
      more visible when BP is being loaded initially via DMLs.  Specifically
      the response time could be impacted in DML doing pessimistic operation
      on index(split/merge) and the leaf pages are not found in buffer pool.
      It is more likely to occur with small BP size.
      
      The origin of the issue dates back to MDEV-30400 that introduced
      btr_cur_t::search_leaf() replacing btr_cur_search_to_nth_level() for
      leaf page searches. In btr_latch_prev, we use RW_NO_LATCH to get the
      previous page fixed in BP without latching. When the page is not in BP,
      we try to acquire and wait for S latch violating the latching order.
      
      This deadlock was analyzed in MDEV-33543 and fixed by using the already
      present wait logic in buf_page_get_gen() instead of waiting for latch.
      The wait logic is inferior to usual S latch wait and is simply a
      repeated sleep 100 of micro-sec (The actual sleep time could be more
      depending on platforms). The bug was seen with "change-buffering" code
      path and the idea was that this path should be less exercised. The
      judgement was not correct and the path is actually quite frequent and
      does impact performance when pages are not in BP and being loaded by
      DML expanding/shrinking large data.
      
      Fix: While trying to get a page with RW_NO_LATCH and we are attempting
      "out of order" latch, return from buf_page_get_gen immediately instead
      of waiting and follow the ordered latching path.
      73ad436e
    • Oleksandr Byelkin's avatar
      Merge branch '10.5' into 10.6 · dcd8a648
      Oleksandr Byelkin authored
      dcd8a648
    • Oleksandr Byelkin's avatar
      Fix compiler errors · a4ef05d0
      Oleksandr Byelkin authored
      a4ef05d0
    • Daniel Black's avatar
      MDEV-34502 InnoDB debug mode build - asserts with Valgrind · 25c6e3e4
      Daniel Black authored
      Valgrind looks as the assertions as examining uninitalized values.
      
      As the assertions are tested in other Debug builds we know
      it isn't all invalid.
      
      Account for Valgrind by removing the assertion under
      the WITH_VALGRIND=1 compulation.
      25c6e3e4
  2. 02 Jul, 2024 3 commits
    • Monty's avatar
      MDEV-34494 Add server_uid global variable and add it to error log at startup · 2739b5f5
      Monty authored
      The feedback plugin server_uid variable and the calculate_server_uid()
      function is moved from feedback/utils.cc to sql/mysqld.cc
      
      server_uid is added as a global variable (shown in 'show variables') and
      is written to the error log on server startup together with server version
      and server commit id.
      2739b5f5
    • Monty's avatar
      MDEV-34491 Setting log_slow_admin="" at startup should be converted to log_slow_admin=ALL · d8c9c5ea
      Monty authored
      We have an issue if a user have the following in a configuration file:
      log_slow_filter=""                  # Log everything to slow query log
      log_queries_not_using_indexes=ON
      
      This set log_slow_filter to 'not_using_index' which disables
      slow_query_logging of most queries.
      In effect, on should never use log_slow_filter="" in config files but
      instead use log_slow_filter=ALL.
      
      Fixed by changing log_slow_filter="" that comes either from a
      configuration file or from the command line, when starting to the server,
      to log_slow_filter=ALL.
      A warning will be printed when this happens.
      
      Other things:
      - One can now use =ALL for any 'set' variable to set all options at once.
        (backported from 10.6)
      d8c9c5ea
    • Lena Startseva's avatar
  3. 01 Jul, 2024 4 commits
  4. 29 Jun, 2024 2 commits
  5. 28 Jun, 2024 2 commits
    • Marko Mäkelä's avatar
      MDEV-32176 Contention in ha_innobase::info_low() · d1ecf5cc
      Marko Mäkelä authored
      During a Sysbench oltp_point_select workload with 1 table and 400
      concurrent connections, a bottleneck on dict_table_t::lock_mutex was
      observed in ha_innobase::info_low().
      
      dict_table_t::lock_latch: Replaces lock_mutex.
      
      In ha_innobase::info_low() and several other places, we will acquire
      a shared dict_table_t::lock_latch or we may elide the latch if
      hardware memory transactions are available.
      
      innobase_build_v_templ(): Remove the parameter "bool locked", and
      require the caller to hold exclusive dict_table_t::lock_latch
      (instead of holding an exclusive dict_sys.latch).
      
      Tested by: Vladislav Vaintroub
      Reviewed by: Vladislav Vaintroub
      d1ecf5cc
    • Lena Startseva's avatar
  6. 27 Jun, 2024 1 commit
    • Meng-Hsiu Chiang's avatar
      [MDEV-28162] Replace PFS_atomic with std::atomic<T> · 55db59f1
      Meng-Hsiu Chiang authored
      PFS_atomic class contains wrappers around my_atomic_* operations, which
      are macros to GNU atomic operations (__atomic_*). Due to different
      implementations of compilers, clang may encounter errors when compiling
      on x86_32 architecture.
      
      The following functions are replaced with C++ std::atomic type in
      performance schema code base:
        - PFS_atomic::store_*()
            -> my_atomic_store*
              -> __atomic_store_n()
          => std::atomic<T>::store()
      
        - PFS_atomic::load_*()
            -> my_atomic_load*
              -> __atomic_load_n()
          => std::atomic<T>::load()
      
        - PFS_atomic::add_*()
            -> my_atomic_add*
              -> __atomic_fetch_add()
          => std::atomic<T>::fetch_add()
      
        - PFS_atomic::cas_*()
          -> my_atomic_cas*
            -> __atomic_compare_exchange_n()
          => std::atomic<T>::compare_exchange_strong()
      
      and PFS_atomic class could be dropped completely.
      
      Note that in the wrapper memory order passed to original GNU atomic
      extensions are hard-coded as `__ATOMIC_SEQ_CST`, which is equivalent to
      `std::memory_order_seq_cst` in C++, and is the default parameter for
      std::atomic_* functions.
      
      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.
      55db59f1
  7. 26 Jun, 2024 4 commits
  8. 25 Jun, 2024 4 commits
    • Yuchen Pei's avatar
      ad0ee8cd
    • Yuchen Pei's avatar
      MDEV-34361 Split my.cnf in the spider suite. · 01289dac
      Yuchen Pei authored
      Just like the spider/bugfix suite.
      
      One caveat is that my_2_3.cnf needs something under mysqld.2.3 group,
      otherwise mtr will fail with something like:
      
      There is no group named 'mysqld.2.3' that can be used to resolve
      'port' for ...
      
      This will allow new tests under the spider suite to use what is
      needed. It also somehow fixes issues of running a test followed by
      spider.slave_trx_isolation.
      01289dac
    • Yuchen Pei's avatar
    • Dmitry Shulga's avatar
      MDEV-24411: Trigger doesn't work correctly with bulk insert · 8b169949
      Dmitry Shulga authored
      Executing an INSERT statement in PS mode having positional parameter
      bound with an array could result in incorrect number of inserted rows
      in case there is a BEFORE INSERT trigger that executes yet another
      INSERT statement to put a copy of row being inserted into some table.
      
      The reason for incorrect number of inserted rows is that a data structure
      used for binding positional argument with its actual values is stored
      in THD (this is thd->bulk_param) and reused on processing every INSERT
      statement. It leads to consuming actual values bound with top-level
      INSERT statement by other INSERT statements used by triggers' body.
      
      To fix the issue, reset the thd->bulk_param temporary to the value nullptr
      before invoking triggers and restore its value on finishing its execution.
      8b169949
  9. 24 Jun, 2024 4 commits
  10. 22 Jun, 2024 3 commits
  11. 21 Jun, 2024 2 commits
  12. 20 Jun, 2024 6 commits
    • Dave Gosselin's avatar
      MDEV-33746 Supply missing override markings · db0c28ef
      Dave Gosselin authored
      Find and fix missing virtual override markings.  Updates cmake
      maintainer flags to include -Wsuggest-override and
      -Winconsistent-missing-override.
      db0c28ef
    • Vlad Lesin's avatar
      MDEV-34108 Inappropriate semi-consistent read in RC if innodb_snapshot_isolation=ON · 0a199cb8
      Vlad Lesin authored
      The fixes in b8a67198 have not disabled
      semi-consistent read for innodb_snapshot_isolation=ON mode, they just allowed
      read uncommitted version of a record, that's why the test for MDEV-26643 worked
      well.
      
      The semi-consistent read should be disabled on upper level in
      row_search_mvcc() for READ COMMITTED isolation level.
      
      Reviewed by Marko Mäkelä.
      0a199cb8
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-34389 Avoid log overwrite in early recovery · ab448d4b
      Thirunarayanan Balathandayuthapani authored
      - InnoDB tries to write FILE_CHECKPOINT marker during
      early recovery when log file size is insufficient.
      While updating the log checkpoint at the end of the recovery,
      InnoDB must already have written out all pending changes
      to the persistent files. To complete the checkpoint, InnoDB
      has to write some log records for the checkpoint and to
      update the checkpoint header. If the server gets killed
      before updating the checkpoint header then it would lead
      the logfile to be unrecoverable.
      
      - This patch avoids FILE_CHECKPOINT marker during early
      recovery and narrows down the window of opportunity to
      make the log file unrecoverable.
      ab448d4b
    • Alexander Barkov's avatar
      MDEV-34417 Wrong result set with utf8mb4_danish_ci and BNLH join · 6cecf61a
      Alexander Barkov authored
      There were erroneous calls for charpos() in key_hashnr() and key_buf_cmp().
      These functions are never called with prefix segments.
      
      The charpos() calls were wrong. Before the change BNHL joins
      - could return wrong result sets, as reported in MDEV-34417
      - were extremely slow for multi-byte character sets, because
        the hash was calculated on string prefixes, which increased
        the amount of collisions drastically.
      
      This patch fixes the wrong result set as reported in MDEV-34417,
      as well as (partially) the performance problem reported in MDEV-34352.
      6cecf61a
    • Monty's avatar
      Disable new connections in case of fatal signal · 279aa1e6
      Monty authored
      A user reported that MariaDB server got a signal 6 but still accepted new
      connections and did not crash.  I have not been able to find a way to
      repeat this or find the cause of issue. However to make it easier to
      notice that the server is unstable, I added code to disable new
      connections when the handle_fatal_signal() handler has been called.
      279aa1e6
    • Monty's avatar
      MDEV-33582 Add more warnings to be able to better diagnose network issues · 3541bd63
      Monty authored
      Changed the logged messages from errors to warnings
      Also changed 'remain' to 'read_length' in the warning to make it more readable.
      3541bd63