1. 08 Feb, 2024 1 commit
    • Marko Mäkelä's avatar
      MDEV-24167 fixup: srw_lock_debug instrumentation · 5f2dcd11
      Marko Mäkelä authored
      While the index_lock and block_lock include debug instrumentation
      to keep track of shared lock holders, such instrumentation was
      never part of the simpler srw_lock, and therefore some users of the
      class implemented a limited form of bookkeeping.
      
      srw_lock_debug encapsulates srw_lock and adds the data members
      writer, readers_lock, and readers to keep track of the threads that
      hold the exclusive latch or any shared latches. The debug checks
      are available also with SUX_LOCK_GENERIC (in environments that do not
      implement a futex-like system call).
      
      dict_sys_t::latch: Use srw_lock_debug in debug builds.
      This makes the debug fields latch_ex, latch_readers redundant.
      
      fil_space_t::latch: Use srw_lock_debug in debug builds.
      This makes the debug field latch_count redundant.
      The field latch_owner must be preserved, because
      fil_space_t::is_owner() is being used in all builds.
      
      lock_sys_t::latch: Use srw_lock_debug in debug builds.
      This makes the debug fields writer, readers redundant.
      
      lock_sys_t::is_holder(): A new debug predicate to check if
      the current thread is holding lock_sys.latch in any mode.
      
      trx_rseg_t::latch: Use srw_lock_debug in debug builds.
      5f2dcd11
  2. 07 Feb, 2024 6 commits
    • Marko Mäkelä's avatar
      Cleanup: Remove ut_format_name() · 8d54d173
      Marko Mäkelä authored
      This follows up commit 383f77cd
      which simplified dict_table_schema_check().
      
      Note: We can display quoted names like this:
      my_snprintf(buf, sizeof buf, "%`.*s.%`s",
                  int(t->name.dblen()), t->name.m_name, t->name.basename());
      8d54d173
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 91a2192b
      Marko Mäkelä authored
      91a2192b
    • Vlad Lesin's avatar
      MDEV-33004 innodb.cursor-restore-locking test fails · f5373db8
      Vlad Lesin authored
      THE FIX MUST NOT BE MERGED TO 10.6+, BECAUSE 10.6+ IS NOT AFFECTED!
      
      The test is waiting for delete-marked record purging. But this does not
      happen under the following conditions:
      
      1. "START TRANSACTION WITH CONSISTENT SNAPSHOT" - is active, has not
      been rolled back yet
      2. "DELETE FROM t WHERE b = 20 # trx_1" - is committed
      3. "INSERT INTO t VALUES(10, 20) # trx_2" - hanging on
      "ib_after_row_insert" sync point, waiting for "first_ins_cont" signal
      4. "DELETE FROM t WHERE b = 20 # trx_3" - blocked on delete-marked by
      trx_1 record, waiting for trx_2
      5. connection "default" is waiting on
      'now WAIT_FOR row_purge_del_mark_finished'
      
      purge_coordinator_callback_low() sets
      
      purge_state.m_history_length= srv_do_purge(&n_total_purged);
      
      even if nothing was purged, like in our case. Nothing was purged because
      transaction with consistent snapshot was still alive during purging
      procedure.
      
      Then purge_coordinator_timer_callback() does not wake purge thread if
      the following condition is true:
      
      purge_state.m_history_length == trx_sys.rseg_history_len
      
      The above condition is true for our case, because we are waiting for
      delete-marked record purging, and trx_sys.rseg_history_len does not
      grow.
      
      Only 10.5 is affected, because there is no such condition in 10.6, i.e.
      purge thread is woken up even if history size was not changed during
      purge coordinator thread suspending.
      
      The easiest way to fix it is just to remove the test from 10.5.
      f5373db8
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-33341 innodb.undo_space_dblwr test case fails with Unknown Storage Engine InnoDB · c31b1ee2
      Thirunarayanan Balathandayuthapani authored
      - Failed to reset the innodb_fil_make_page_dirty_debug variable in
      innodb_saved_page_number_debug_basic test case.
      c31b1ee2
    • Yuchen Pei's avatar
    • Daniel Black's avatar
      MDEV-33397: Innodb include OS error information when failing to write to iblogfileX · e06b159f
      Daniel Black authored
      Without an OS error it could one of the many errors from write.
      e06b159f
  3. 06 Feb, 2024 7 commits
  4. 05 Feb, 2024 2 commits
    • Brandon Nesterenko's avatar
      MDEV-32551: Fix engines/funcs.rpl_session_var · bde552ae
      Brandon Nesterenko authored
      MDEV-32551 changed rpl/t/rpl_session_var.test to show its
      semi-sync status, as it added a semi-sync version of the
      test (rpl_session_var2). The result was re-recorded in the
      rpl suite, but there is an engines/funcs counter-part result
      file that uses the same .test file which also needed to be
      re-recorded.
      bde552ae
    • Yuchen Pei's avatar
      MDEV-33242 Make Spider init queries compatible with non-default old_mode · 1031c884
      Yuchen Pei authored
      Add UTF8_IS_UTF8MB3 to the (session) old_mode in connections made with
      sql service to run init queries
      
      The connection is new and the global variable value takes effect
      rather than the session value from the caller of spider_db_init
      1031c884
  5. 04 Feb, 2024 1 commit
    • Igor Babaev's avatar
      MDEV-31361 Wrong result on 2nd execution of PS for query with derived table · 6fadbf8e
      Igor Babaev authored
      This bug led to wrong result sets returned by the second execution of
      prepared statements from selects using mergeable derived tables pushed
      into external engine. Such derived tables are always materialized. The
      decision that they have to be materialized is taken late in the function
      mysql_derived_optimized(). For regular derived tables this decision is
      usually taken at the prepare phase. However in some cases for some derived
      tables this decision is made in mysql_derived_optimized() too. It can be
      seen in the code of mysql_derived_fill() that for such a derived table it's
      critical to change its translation table to tune it to the fields of the
      temporary table used for materialization of the derived table and this
      must be done after each refill of the derived table. The same actions are
      needed for derived tables pushed into external engines.
      
      Approved by Oleksandr Byelkin <sanja@mariadb.com>
      6fadbf8e
  6. 02 Feb, 2024 3 commits
    • Sergei Petrunia's avatar
      Make innodb_ext_key test stable: use innodb_stable_estimates.inc · 9d0b79c5
      Sergei Petrunia authored
      @@ -314,7 +314,7 @@
       select straight_join * from t0, part ignore index (primary)
       where p_partkey=t0.a and p_size=1;
       id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
      -1	SIMPLE	t0	ALL	NULL	NULL	NULL	NULL	5	Using where
      +1	SIMPLE	t0	ALL	NULL	NULL	NULL	NULL	6	Using where
       1	SIMPLE	part	eq_ref	i_p_size	i_p_size	9	const,dbt3_s001.t0.a	1
      9d0b79c5
    • Sergei Petrunia's avatar
      MDEV-33314: Crash in calculate_cond_selectivity_for_table() with many columns · 5972f5c2
      Sergei Petrunia authored
      Variant#3: moved the logic out of create_key_parts_for_pseudo_indexes
      
      Range Analyzer (get_mm_tree functions) can only process up to MAX_KEY=64
      indexes. The problem was that calculate_cond_selectivity_for_table used
      it to estimate selectivities for columns, and since a table can
      have > MAX_KEY columns, would invoke Range Analyzer with more than MAX_KEY
      "pseudo-indexes".
      
      Fixed by making calculate_cond_selectivity_for_table() to run Range
      Analyzer with at most MAX_KEY pseudo-indexes. If there are more
      columns to process, Range Analyzer will be invoked multiple times.
      
      Also made this change:
      -    param.real_keynr[0]= 0;
      +    MEM_UNDEFINED(&param.real_keynr, sizeof(param.real_keynr));
      
      Range Analyzer should have no use on real_keynr when it is run with
      pseudo-indexes.
      5972f5c2
    • Alexander Barkov's avatar
      MDEV-32893 mariadb-backup is not considering O/S user when --user option is omitted · 78662dda
      Alexander Barkov authored
      mariadb-backup:
      
      Adding a function get_os_user() to detect the OS user name
      if the user name is not specified, to make mariadb-backup:
      - work like MariaDB client tools work
      - match its --help page, which says:
      
        -u, --user=name This option specifies the username used when
        connecting to the server, if that's not the current user.
      78662dda
  7. 01 Feb, 2024 3 commits
  8. 31 Jan, 2024 8 commits
    • Sergei Golubchik's avatar
      fix columnstore compilation on fc39 · 2278f350
      Sergei Golubchik authored
      2278f350
    • Sergei Golubchik's avatar
      Merge branch '10.5' into 10.6 · 3f6038bc
      Sergei Golubchik authored
      3f6038bc
    • Sergei Golubchik's avatar
      Merge branch '10.4' into 10.5 · 01f6abd1
      Sergei Golubchik authored
      01f6abd1
    • Sergei Golubchik's avatar
      funcs_1.innodb_views times out in --ps · 46e3a765
      Sergei Golubchik authored
      46e3a765
    • Nikita Malyavin's avatar
      MDEV-25370 Update for portion changes autoincrement key in bi-temp table · 68c1fbfc
      Nikita Malyavin authored
      According to the standard, the autoincrement column (i.e. *identity
      column*) should be advanced each insert implicitly made by
      UPDATE/DELETE ... FOR PORTION.
      
      This is very unconvenient use in several notable cases. Concider a
      WITHOUT OVERLAPS key with an autoinc column:
      id int auto_increment, unique(id, p without overlaps)
      
      An update or delete with FOR PORTION creates a sense that id will remain
      unchanged in such case.
      
      The standard's IDENTITY reminds MariaDB's AUTO_INCREMENT, however
      the generation rules differ in many ways. For example, there's also a
      notion autoincrement index, which is bound to the autoincrement field.
      
      We will define our own generation rule for the PORTION OF operations
      involving AUTO_INCREMENT:
      * If an autoincrement index contains WITHOUT OVERLAPS specification, then
      a new value should not be generated, otherwise it should.
      
      Apart from WITHOUT OVERLAPS there is also another notable case, referred
      by the reporter - a unique key that has an autoincrement column and a field
      from the period specification:
        id int auto_increment, unique(id, s), period for p(s, e)
      
      for this case, no exception is made, and the autoincrementing rules will be
      proceeded accordung to the standard (i.e. the value will be advanced on
      implicit inserts).
      68c1fbfc
    • Sergei Golubchik's avatar
      regression introduced by MDEV-14448 · e5147c81
      Sergei Golubchik authored
      e5147c81
    • Sergei Golubchik's avatar
      MDEV-33343 spider.mdev_28739_simple fails in buildbot · d1744ee7
      Sergei Golubchik authored
      test disabled, until fixed
      d1744ee7
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-33341 innodb.undo_space_dblwr test case fails with Unknown Storage Engine InnoDB · 21f18bd9
      Thirunarayanan Balathandayuthapani authored
      Reason:
      ======
      undo_space_dblwr test case fails if the first page of undo
      tablespace is not flushed before restart the server. While
      restarting the server, InnoDB fails to detect the first
      page of undo tablespace from doublewrite buffer.
      
      Fix:
      ===
      Use "ib_log_checkpoint_avoid_hard" debug sync point
      to avoid checkpoint and make sure to flush the
      dirtied page before killing the server.
      
      innodb_make_page_dirty(): Fails to set
      srv_fil_make_page_dirty_debug variable.
      21f18bd9
  9. 30 Jan, 2024 3 commits
    • Oleksandr Byelkin's avatar
      workaround for MDEV-33218 · 908c9cf9
      Oleksandr Byelkin authored
      908c9cf9
    • Brandon Nesterenko's avatar
      MDEV-33327: rpl_seconds_behind_master_spike Sensitive to IO Thread Stop Position · c75905ca
      Brandon Nesterenko authored
      rpl.rpl_seconds_behind_master_spike uses the DEBUG_SYNC mechanism to
      count how many format descriptor events (FDEs) have been executed,
      to attempt to pause on a specific relay log FDE after executing
      transactions. However, depending on when the IO thread is stopped,
      it can send an extra FDE before sending the transactions, forcing
      the test to pause before executing any transactions, resulting in a
      table not existing, that is attempted to be read for COUNT.
      
      This patch fixes this by no longer counting FDEs, but rather by
      programmatically waiting until the SQL thread has executed the
      transaction and then automatically activating the DEBUG_SYNC point
      to trigger at the next relay log FDE.
      c75905ca
    • Tuukka Pasanen's avatar
      MDEV-32935: Remove unneeded CMAKE_SYSTEM_PROCESSOR parameter from Debian · 6914b780
      Tuukka Pasanen authored
      There is no need for CMAKE_SYSTEM_PROCESSOR parameter in Debian
      build as dh_auto_configure should handle things better and
      more reliable
      6914b780
  10. 29 Jan, 2024 1 commit
  11. 27 Jan, 2024 3 commits
  12. 26 Jan, 2024 2 commits
    • Brandon Nesterenko's avatar
      MDEV-27850: rpl_seconds_behind_master_spike debug_sync fix · 112eb14f
      Brandon Nesterenko authored
      A debug_sync signal could remain for the SQL thread that should have begun
      a wait_for upon seeing a GTID event, but would instead see the old signal
      and continue on without waiting. This broke an "idle" condition in
      SHOW SLAVE STATUS
      which should have automatically negated Seconds_Behind_Master. Instead,
      because the SQL thread had already processed the GTID event, it set
      sql_thread_caught_up to false, and thereby calculated the value of
      Seconds_behind_master, when the test expected 0.
      
      This patch fixes this by resetting the debug_sync state before creating a
      new transaction which sends a GTID event to the replica
      112eb14f
    • Vladislav Vaintroub's avatar
      354e97cd