1. 21 Aug, 2023 1 commit
    • Marko Mäkelä's avatar
      Remove a stale comment · be5fd3ec
      Marko Mäkelä authored
      buf_LRU_block_remove_hashed(): Remove a comment that had been added
      in mysql/mysql-server@aad1c7d0dd8a152ef6bb685356c68ad9978d686a
      and apparently referring to buf_LRU_invalidate_tablespace(),
      which was later replaced with buf_LRU_flush_or_remove_pages() and
      ultimately with buf_flush_remove_pages() and buf_flush_list_space().
      All that code is covered by buf_pool.mutex. The note about releasing
      the hash_lock for the buf_pool.page_hash slice would actually apply to
      the last reference to hash_lock in buf_LRU_free_page(), for the
      case zip=false (retaining a ROW_FORMAT=COMPRESSED page while
      discarding the uncompressed one).
      be5fd3ec
  2. 17 Aug, 2023 4 commits
  3. 16 Aug, 2023 1 commit
    • Kristian Nielsen's avatar
      MDEV-29974: Missed kill waiting for worker queues to drain · 34e85854
      Kristian Nielsen authored
      When the SQL driver thread goes to wait for room in the parallel slave
      worker queue, there was a race where a kill at the right moment could
      be ignored and the wait proceed uninterrupted by the kill.
      
      Fix by moving the THD::check_killed() to occur _after_ doing ENTER_COND().
      
      This bug was seen as sporadic failure of the testcase rpl.rpl_parallel
      (rpl.rpl_parallel_gco_wait_kill since 10.5), with "Slave stopped with
      wrong error code".
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      34e85854
  4. 15 Aug, 2023 9 commits
    • Kristian Nielsen's avatar
      Merge 10.4 into 10.5 · 7c9837ce
      Kristian Nielsen authored
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      7c9837ce
    • Kristian Nielsen's avatar
      MDEV-31655: Parallel replication deadlock victim preference code errorneously removed · 900c4d69
      Kristian Nielsen authored
      Restore code to make InnoDB choose the second transaction as a deadlock
      victim if two transactions deadlock that need to commit in-order for
      parallel replication. This code was erroneously removed when VATS was
      implemented in InnoDB.
      
      Also add a test case for InnoDB choosing the right deadlock victim.
      Also fixes this bug, with testcase that reliably reproduces:
      
      MDEV-28776: rpl.rpl_mark_optimize_tbl_ddl fails with timeout on sync_with_master
      
      Note: This should be null-merged to 10.6, as a different fix is needed
      there due to InnoDB locking code changes.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      900c4d69
    • Kristian Nielsen's avatar
      MDEV-31482: Lock wait timeout with INSERT-SELECT, autoinc, and statement-based replication · 920789e9
      Kristian Nielsen authored
      Remove the exception that InnoDB does not report auto-increment locks waits
      to the parallel replication.
      
      There was an assumption that these waits could not cause conflicts with
      in-order parallel replication and thus need not be reported. However, this
      assumption is wrong and it is possible to get conflicts that lead to hangs
      for the duration of --innodb-lock-wait-timeout. This can be seen with three
      transactions:
      
      1. T1 is waiting for T3 on an autoinc lock
      2. T2 is waiting for T1 to commit
      3. T3 is waiting on a normal row lock held by T2
      
      Here, T3 needs to be deadlock killed on the wait by T1.
      
      Note: This should be null-merged to 10.6, as a different fix is needed
      there due to InnoDB lock code changes.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      920789e9
    • Marko Mäkelä's avatar
      Remove the often-hanging test innodb.alter_rename_files · b4ace139
      Marko Mäkelä authored
      The test innodb.alter_rename_files rather frequently hangs in
      checkpoint_set_now. The test was removed in MariaDB Server 10.5
      commit 37e7bde1 when the code that
      it aimed to cover was simplified. Starting with MariaDB Server 10.5
      the page flushing and log checkpointing is much simpler, handled
      by the single buf_flush_page_cleaner() thread.
      
      Let us remove the test to avoid occasional failures. We are not going
      to fix the cause of the failure in MariaDB Server 10.4.
      b4ace139
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 599c4d9a
      Marko Mäkelä authored
      599c4d9a
    • Marko Mäkelä's avatar
      Merge mariadb-10.4.31 into 10.4 · 6fdc6846
      Marko Mäkelä authored
      6fdc6846
    • Marko Mäkelä's avatar
      Merge mariadb-10.5.22 into 10.5 · 2e78465d
      Marko Mäkelä authored
      2e78465d
    • Alexander Barkov's avatar
      MDEV-24797 Column Compression - ERROR 1265 (01000): Data truncated for column · 9c8ae6dc
      Alexander Barkov authored
      Fix issue was earlier fixed by MDEV-31724. Only adding MTR tests.
      9c8ae6dc
    • Alexander Barkov's avatar
      MDEV-31724 Compressed varchar values lost on joins when sorting on columns from joined table(s) · 1fa7c9a3
      Alexander Barkov authored
      Field_varstring::get_copy_func() did not take into account
      that functions do_varstring1[_mb], do_varstring2[_mb] do not support
      compressed data.
      
      Changing the return value of Field_varstring::get_copy_func()
      to `do_field_string` if there is a compresion and truncation
      at the same time. This fixes the problem, so now it works as follows:
      - val_str() uncompresses the data
      - The prefix is then calculated on the uncompressed data
      
      Additionally, introducing two new copying functions
      - do_varstring1_no_truncation()
      - do_varstring2_no_truncation()
      
      Using new copying functions in cases when:
      - a Field_varstring with length_bytes==1 is changing to a longer
          Field_varstring with length_bytes==1
      - a Field_varstring with length_bytes==2 is changing to a longer
          Field_varstring with length_bytes==2
      
      In these cases we don't care neither of compression nor
      of multi-byte prefixes: the entire data gets fully copied
      from the source column to the target column as is.
      
      This is a kind of new optimization, but this also was needed
      to preserve existing MTR test results.
      1fa7c9a3
  5. 14 Aug, 2023 2 commits
  6. 11 Aug, 2023 1 commit
  7. 10 Aug, 2023 5 commits
    • Oleksandr Byelkin's avatar
      Merge branch '10.4' into 10.5 · 7e650253
      Oleksandr Byelkin authored
      7e650253
    • Monty's avatar
      MDEV-31893 Valgrind reports issues in main.join_cache_notasan · 2aea9387
      Monty authored
      This is also related to
      MDEV-31348 Assertion `last_key_entry >= end_pos' failed in virtual bool
                 JOIN_CACHE_HASHED::put_record()
      
      Valgrind exposed a problem with the join_cache for hash joins:
      =25636== Conditional jump or move depends on uninitialised value(s)
      ==25636== at 0xA8FF4E: JOIN_CACHE_HASHED::init_hash_table()
                (sql_join_cache.cc:2901)
      
      The reason for this was that avg_record_length contained a random value
      if one had used SET optimizer_switch='optimize_join_buffer_size=off'.
      
      This causes either 'random size' memory to be allocated (up to
      join_buffer_size) which can increase memory usage or, if avg_record_length
      is less than the row size, memory overwrites in thd->mem_root, which is
      bad.
      
      Fixed by setting avg_record_length in JOIN_CACHE_HASHED::init()
      before it's used.
      
      There is no test case for MDEV-31893 as valgrind of join_cache_notasan
      checks that.
      I added a test case for MDEV-31348.
      2aea9387
    • Kristian Nielsen's avatar
      MDEV-23021: rpl.rpl_parallel_optimistic_until fails in Buildbot · b2e312b0
      Kristian Nielsen authored
      The test case accessed slave-relay-bin.000003 without waiting for the IO
      thread to write it first. If the IO thread was slow, this could fail.
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      b2e312b0
    • Kristian Nielsen's avatar
      MDEV-381: fdatasync() does not correctly flush growing binlog file · 5055490c
      Kristian Nielsen authored
      Revert the old work-around for buggy fdatasync() on Linux ext3. This bug was
      fixed in Linux > 10 years ago back to kernel version at least 3.0.
      Reviewed-by: default avatarMarko Mäkelä <marko.makela@mariadb.com>
      Signed-off-by: default avatarKristian Nielsen <knielsen@knielsen-hq.org>
      5055490c
    • Monty's avatar
      MDEV-31893 Valgrind reports issues in main.join_cache_notasan · e9333ff0
      Monty authored
      This is also related to
      MDEV-31348 Assertion `last_key_entry >= end_pos' failed in virtual bool
                 JOIN_CACHE_HASHED::put_record()
      
      Valgrind exposed a problem with the join_cache for hash joins:
      =25636== Conditional jump or move depends on uninitialised value(s)
      ==25636== at 0xA8FF4E: JOIN_CACHE_HASHED::init_hash_table()
                (sql_join_cache.cc:2901)
      
      The reason for this was that avg_record_length contained a random value
      if one had used SET optimizer_switch='optimize_join_buffer_size=off'.
      
      This causes either 'random size' memory to be allocated (up to
      join_buffer_size) which can increase memory usage or, if avg_record_length
      is less than the row size, memory overwrites in thd->mem_root, which is
      bad.
      
      Fixed by setting avg_record_length in JOIN_CACHE_HASHED::init()
      before it's used.
      
      There is no test case for MDEV-31893 as valgrind of join_cache_notasan
      checks that.
      I added a test case for MDEV-31348.
      e9333ff0
  8. 08 Aug, 2023 5 commits
  9. 06 Aug, 2023 1 commit
  10. 04 Aug, 2023 1 commit
  11. 03 Aug, 2023 1 commit
    • Oleg Smirnov's avatar
      MDEV-31743 Server crash in store_length, assertion failure in... · 8e8c020f
      Oleg Smirnov authored
      MDEV-31743 Server crash in store_length, assertion failure in Type_handler_string_result::sort_length
      
      After MDEV-21580 the truncation of SORT_FIELD::length
        set_if_smaller(sortorder->length, thd->variables.max_sort_length)
      
      became conditional:
        if (is_variable_sized())
          set_if_smaller(length, thd->variables.max_sort_length)
      
      To provide correct functioning of is_variable_sized() SORT_FIELD::type
      must be set properly. This commit adds the necessary initialization
      of SORT_FIELD::type to JOIN_TAB::remove_duplicates() as it is done
      in filesort's sortlength() function.
      
      DBUG_ASSERT is added to sortlength() just in case to prevent
      a possible uint32 overflow
      8e8c020f
  12. 02 Aug, 2023 4 commits
    • Christian Hesse's avatar
      update galera_new_cluster to use environment file · b54e4bf0
      Christian Hesse authored
      Now that the systemd unit files use an environment file to pass
      _WSREP_START_POSITION we have to update galera_new_cluster as well.
      b54e4bf0
    • Christian Hesse's avatar
      use environment file in systemd units for _WSREP_START_POSITION · 6c405904
      Christian Hesse authored
      We used to run `systemctl set-environment` to pass
      _WSREP_START_POSITION. This is bad because:
      
      * it clutter systemd's environment (yes, pid 1)
      * it requires root privileges
      * options (like LimitNOFILE=) are not applied
      
      Let's just create an environment file in ExecStartPre=, that is read
      before ExecStart= kicks in. We have _WSREP_START_POSITION around for the
      main process without any downsides.
      6c405904
    • Sergei Golubchik's avatar
      MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning... · 61acb436
      Sergei Golubchik authored
      MDEV-31822 ALTER TABLE ENGINE=x started failing instead of producing warning on unsupported TRANSACTIONAL=1
      
      make TRANSACTIONAL table option behave similar to other engine-defined
      table options. If the engine doesn't suport it:
      * if specified expicitly in CREATE or ALTER - it's ER_UNKNOWN_OPTION
      * an error or a warning depending on sql_mode IGNORE_BAD_TABLE_OPTIONS
      * in ALTER TABLE from the engine that suppors it to the engine that
        doesn't - silently preserved (no warning)
      * it is commented out in SHOW CREATE unless IGNORE_BAD_TABLE_OPTIONS
      61acb436
    • Sergei Golubchik's avatar
      MDEV-18114 Foreign Key Constraint actions don't affect Virtual Column · da09ae05
      Sergei Golubchik authored
      * invoke check_expression() for all vcol_info's in
        mysql_prepare_create_table() to check for FK CASCADE
      * also check for SET NULL and SET DEFAULT
      * to check against existing FKs when a vcol is added in ALTER TABLE,
        old FKs must be added to the new_key_list just like other indexes are
      * check columns recursively, if vcol1 references vcol2,
        flags of vcol2 must be taken into account
      * remove check_table_name_processor(), put that logic under
        check_vcol_func_processor() to avoid walking the tree twice
      da09ae05
  13. 01 Aug, 2023 5 commits