1. 02 May, 2023 1 commit
  2. 28 Apr, 2023 2 commits
  3. 27 Apr, 2023 12 commits
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.8 · 5028b7c7
      Marko Mäkelä authored
      5028b7c7
    • Marko Mäkelä's avatar
      MDEV-29401 InnoDB history list length increased in 10.6 compared to 10.5 · 4a668c18
      Marko Mäkelä authored
      The InnoDB buffer pool and locking were heavily refactored in
      MariaDB Server 10.6. Among other things, dict_sys.mutex was removed,
      and the contended lock_sys.mutex was replaced with a combination of
      lock_sys.latch and distributed latches in hash tables. Also, a
      default value was changed to innodb_flush_method=O_DIRECT to improve
      performance in write-heavy workloads.
      
      One thing where an adjustment was missing is around the parameters
      innodb_max_purge_lag (number of committed transactions waiting to
      be purged), and innodb_max_purge_lag_delay
      (maximum number of microseconds to delay a DML operation).
      
      purge_coordinator_state::do_purge(): Pass the history_size to trx_purge()
      and reset srv_dml_needed_delay if the history is empty.
      Keep executing the loop non-stop as long as srv_dml_needed_delay is set.
      
      trx_purge_dml_delay(): Made part of trx_purge().
      Set srv_dml_needed_delay=0 when nothing can be purged (!n_pages_handled).
      
      row_mysql_delay_if_needed(): Mimic the logic of
      innodb_max_purge_lag_wait_update().
      
      Reviewed by: Thirunarayanan Balathandayuthapani
      4a668c18
    • Marko Mäkelä's avatar
      Merge 10.9 into 10.10 · 4f16e953
      Marko Mäkelä authored
      4f16e953
    • Monty's avatar
      Cleanup of MDEV-14974: --port ignored for --host=localhost · f272463b
      Monty authored
      The old code added to 10.6 was inconsisting in how TCP/IP and
      socket connection was chosen. One got also a confusing warning
      in some cases.
      
      Examples:
      > ../client/mysql --print-defaults
      ../client/mysql would have been started with the following arguments:
      --socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash
      > ../client/mysql
      ERROR 2002 (HY000): Can't connect to local server through socket '/tmp/mariadbd.sock' (2)
      > ../client/mysql --print-defaults
      ../client/mysql would have been started with the following arguments:
      --socket=/tmp/mariadbd.sock --port=3307 --no-auto-rehash
      > ../client/mysql --port=3333
      WARNING: Forcing protocol to  TCP  due to option specification. Please explicitly state intended protocol.
      ERROR 2002 (HY000): Can't connect to server on 'localhost' (111)
      > ../client/mysql --port=3333 --socket=sss
      ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2)
      > ../client/mysql --socket=sss --port=3333
      ERROR 2002 (HY000): Can't connect to local server through socket 'sss' (2)
      
      Some notable things:
      - One gets a warning if one uses just --port if config file sets socket
      - Using port and socket gives no warning
      - Using socket and then port still uses socket
      
      This patch changes things the following ways:
      If --port= is given on the command line, the the protocol is automatically
        changed to "TCP/IP".
      - If --socket= is given on the command line, the protocol is automatically
        changed to "socket".
      - The last option wins
      - No warning is given if protocol changes automatically.
      f272463b
    • Daniel Black's avatar
      deb: sid - debian autobake · d0a71e90
      Daniel Black authored
      Deb-autobakes where failing with:
      
      dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run exists in debian/tmp but is not installed to anywhere
      dh_missing: warning: usr/share/mysql/mysql-test/mtr exists in debian/tmp but is not installed to anywhere
      dh_missing: warning: usr/share/mysql/mysql-test/mariadb-test-run exists in debian/tmp but is not installed to anywhere
      dh_missing: warning: usr/share/mysql/mysql-test/mysql-test-run.pl exists in debian/tmp but is not installed to anywhere
      
      Add all to mariadb-test.install and remove mariadb-test.links
      d0a71e90
    • Marko Mäkelä's avatar
      Merge 10.8 into 10.9 · 436d8ef6
      Marko Mäkelä authored
      436d8ef6
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.8 · bbd261bb
      Marko Mäkelä authored
      bbd261bb
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · bb1d1dc8
      Marko Mäkelä authored
      bb1d1dc8
    • Marko Mäkelä's avatar
      Merge 10.4 into 10.5 · 902c6222
      Marko Mäkelä authored
      902c6222
    • Yuchen Pei's avatar
      MDEV-29644 post-merge fixup · 6fccf8ba
      Yuchen Pei authored
      Applying b98375f9 instead of 9b32e4b1 for version 10.5-10.8.
      Applying 5075f4e0 instead of 9b32e4b1 for version 10.9+.
      6fccf8ba
    • Tuukka Pasanen's avatar
      MDEV-30837: Remove usage of AWK in autobake-debs.sh · c5e50c48
      Tuukka Pasanen authored
      AWK is used in autobake-debs.sh for printing information
      about created DEB packages.
      
      This can be rewrite with bash inner commands read and echo.
      c5e50c48
    • Tuukka Pasanen's avatar
      MDEV-30837: Remove usage of AWK from Debian init and postinst scripts · f99a8918
      Tuukka Pasanen authored
      AWK in used in Debian SysV-init and postinst scripts to determine
      is there enough space starting MariaDB database or create new
      database to target destination.
      
      These AWK scripts can be rewrited to use pure SH or help
      using Coreutils which is mandatory for usage of MariaDB currently.
      
      Reasoning behind this is to get rid of one very less used dependency
      f99a8918
  4. 26 Apr, 2023 8 commits
    • Marko Mäkelä's avatar
      Merge 10.9 into 10.10 · ce6616aa
      Marko Mäkelä authored
      ce6616aa
    • Marko Mäkelä's avatar
      After-merge fix · 09fdd3ac
      Marko Mäkelä authored
      This fixes up commit e3f6e1c9
      09fdd3ac
    • Marko Mäkelä's avatar
      Merge 10.8 into 10.9 · e3f6e1c9
      Marko Mäkelä authored
      e3f6e1c9
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.8 · c15c8ef3
      Marko Mäkelä authored
      c15c8ef3
    • Marko Mäkelä's avatar
      MDEV-31132 Deadlock between DDL and purge of InnoDB history · 5740638c
      Marko Mäkelä authored
      log_free_check(): Assert that the caller must not hold
      exclusive lock_sys.latch. This was the case for calls from
      ibuf_delete_for_discarded_space(). This caused a deadlock with
      another thread that would be holding a latch on a dirty page
      that would need to be written so that the checkpoint would advance
      and log_free_check() could return. That other thread was waiting
      for a shared lock_sys.latch.
      
      fil_delete_tablespace(): Do not invoke ibuf_delete_for_discarded_space()
      because in DDL operations, we will be holding exclusive lock_sys.latch.
      
      trx_t::commit(std::vector<pfs_os_file_t>&), innodb_drop_database(),
      row_purge_remove_clust_if_poss_low(), row_undo_ins_remove_clust_rec(),
      row_discard_tablespace_for_mysql():
      Invoke ibuf_delete_for_discarded_space() on the deleted tablespaces after
      releasing all latches.
      5740638c
    • Marko Mäkelä's avatar
      MDEV-26055: Correct the formula for adaptive flushing · d4265fbd
      Marko Mäkelä authored
      page_cleaner_flush_pages_recommendation(): If dirty_pct is
      between innodb_max_dirty_pages_pct_lwm
      and innodb_max_dirty_pages_pct,
      scale the effort relative to how close we are to
      innodb_max_dirty_pages_pct.
      
      The previous formula was missing a multiplication by 100.
      
      Tested by: Axel Schwenke
      d4265fbd
    • Sergei Golubchik's avatar
      MDEV-30218 update test result · b942f414
      Sergei Golubchik authored
      followup for d1a46c68
      b942f414
    • Sergei Golubchik's avatar
      MDEV-11356 Option skip-core-file does not work · b3817425
      Sergei Golubchik authored
      remove ancient hard-coded treatment of --core-file. This enables
      normal my_getopt behavior for the already existing sysvar
      b3817425
  5. 25 Apr, 2023 6 commits
    • Julius Goryavsky's avatar
      MDEV-30804 addendum for 10.6+ branches · 898320b5
      Julius Goryavsky authored
      This addition to MDEV-30804 is relevant for 10.6+, it excludes
      the mixed transaction section using both innodb and aria storage
      engines from the galera_var_replicate_aria_off test, since such
      transactions cannot be executed unless aria supports two-phase
      transaction commit. No additional tests are required as this
      commit fixes the mtr test itself.
      898320b5
    • Andrei's avatar
      MDEV-30620 Trying to lock uninitialized LOCK_parallel_entry · e22a57da
      Andrei authored
      The error was seen by a number of mtr tests being caused
      by overdue initialization of rpl_parallel::LOCK_parallel_entry.
      Specifically, SHOW-SLAVE-STATUS might find in
      rpl_parallel::workers_idle() a gtid domain hash entry
      already inserted whose mutex had not done
      mysql_mutex_init().
      
      Fixed with swapping the mutex init and the its entry's stack insertion.
      
      Tested with a generous number of `mtr --repeat` of a few of the reported
      to fail tests, incl rpl.parallel_backup.
      e22a57da
    • Marko Mäkelä's avatar
      MDEV-26827 fixup: Prevent a hang in LRU eviction · c22ab93f
      Marko Mäkelä authored
      buf_pool_t::page_cleaner_wakeup(): If for_LRU=true, wake up the page
      cleaner immediately, also when it is in a timed wait. This avoids an
      unnecessary delay of up to 1 second.
      c22ab93f
    • Sergei Petrunia's avatar
      MDEV-31121: ANALYZE statement produces 0 for all timings in embedded server · a72b2c3f
      Sergei Petrunia authored
      Timers require my_timer_init() call.
      It was made only in mysqld_main(). Call it also from init_embedded_server().
      a72b2c3f
    • Marko Mäkelä's avatar
      Merge 10.5 into 10.6 · 818d5e48
      Marko Mäkelä authored
      818d5e48
    • Marko Mäkelä's avatar
      MDEV-31124 Innodb_data_written miscounts doublewrites · 50f3b7d1
      Marko Mäkelä authored
      When commit a5a2ef07
      implemented asynchronous doublewrite, the writes via
      the doublewrite buffer started to be counted incorrectly,
      without multiplying them by innodb_page_size.
      
      srv_export_innodb_status(): Correctly count the
      Innodb_data_written.
      
      buf_dblwr_t: Remove submitted(), because it is close to written()
      and only Innodb_data_written was interested in it. According to
      its name, it should count completed and not submitted writes.
      
      Tested by: Axel Schwenke
      50f3b7d1
  6. 24 Apr, 2023 10 commits
    • Brandon Nesterenko's avatar
      MDEV-31038: Parallel Replication Breaks if XA PREPARE Fails Updating Slave GTID State · 31f09e36
      Brandon Nesterenko authored
      If a replica failed to update the GTID slave state when committing
      an XA PREPARE, the replica would retry the transaction and get an
      out-of-order GTID error. This is because the commit phase of an XA
      PREPARE is bifurcated. That is, first, the prepare is handled by the
      relevant storage engines. Then second, the GTID slave state is
      updated as a separate autocommit transaction. If the second phase
      fails, and the transaction is retried, then the same transaction is
      attempted to be committed again, resulting in a GTID out-of-order
      error.
      
      This patch fixes this error by immediately stopping the slave and
      reporting the appropriate error. That is, there was logic to bypass
      the error when updating the GTID slave state table if the underlying
      error is allowed for retry on a parallel slave. This patch adds a
      parameter to disallow the error bypass, thereby forcing the error
      state to still happen.
      
      Reviewed By
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      31f09e36
    • Brandon Nesterenko's avatar
      MDEV-30430: Enabling system versioning on tables without primary key breaks replication · 29fb0410
      Brandon Nesterenko authored
      When replicating MDL events for a table that uses system versioning
      without primary keys, ensure that for data sets with duplicate
      records, the updates to these records with duplicates are enacted on
      the correct row. That is, there was a bug (reported in MDEV-30430)
      such that the function to find the row to update would stop after
      finding the first matching record. However, in the absence of
      primary keys, the version of the record is needed to compare the row
      to ensure we are updating the correct one.
      
      The fix, therefore, updates the record comparison functionality to
      use system version columns when there are no primary keys on the
      table.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      29fb0410
    • Brandon Nesterenko's avatar
      MDEV-28798: Cosmetic Changes Only · 4ec3dca3
      Brandon Nesterenko authored
      Removed trailing whitespaces
      4ec3dca3
    • Brandon Nesterenko's avatar
      MDEV-28798: Previously Binlog Encrypted Master Segfaults on Binlog Dump with Using_Gtid=Slave_Pos · d3e7dba3
      Brandon Nesterenko authored
      Problem:
      ========
      A master can segfault if it can't set up decryption for its binary
      log during a binlog dump with Using_Gtid=Slave_Pos. If slave
      connects using GTID mode, the master will call into
      log.cc::get_gtid_list_event(), which iterate through binlog events
      looking for a Gtid_list_log_event. On an encrypted binlog that the
      master cannot decrypt, the first event will be a
      START_ENCRYPTION_EVENT which will call into the following decryption branch
      
      if (fdle->start_decryption((Start_encryption_log_event*) ev))
        errormsg= ‘Could not set up decryption for binlog.’;
      
      The event iteration however, does not stop in spite of this error.
      The master will try to read the next event, but segfault while
      trying to decrypt it because decryption failed to initialize.
      
      Solution:
      ========
      Break the event iteration if decryption cannot be set up.
      
      Reviewed By:
      ============
      Andrei Elkin <andrei.elkin@mariadb.com>
      d3e7dba3
    • Igor Babaev's avatar
      MDEV-31102 Crash when pushing condition into view defined as union · 5dc9a6b4
      Igor Babaev authored
      This bug could manifest itself at the first execution of prepared statement
      created for queries using a materialized view defined as union. A crash
      could happen for sure if the query contained a condition pushable into
      the view and this condition was over the column defined via a complex string
      expression requiring implicit conversion from one charset to another for
      some of its sub-expressions. The bug could cause crashes when executing
      PS for some other queries whose optimization needed building clones for
      such expressions.
      
      This bug was introduced in the patch for MDEV-29988 where the class
      Item_direct_ref_to_item was added. The implementations of the virtual
      methods get_copy() and build_clone() were invalid for the class and this
      could cause crashes after the method build_clone() was called for
      expressions containing objects of the Item_direct_ref_to_item type.
      
      Approved by Sergei Golubchik <serg@mariadb.com>
      5dc9a6b4
    • Marko Mäkelä's avatar
      Merge 10.6 into 10.8 · 3c250778
      Marko Mäkelä authored
      3c250778
    • Oleksandr Byelkin's avatar
      Merge branch '10.4' into 10.5 · 1d74927c
      Oleksandr Byelkin authored
      1d74927c
    • Marko Mäkelä's avatar
      MDEV-31114 Assertion !...is_waiting() failed in os_aio_wait_until_no_pending_writes() · 0976afec
      Marko Mäkelä authored
      os_aio_wait_until_no_pending_reads(), os_aio_wait_until_pending_writes():
      Add a Boolean parameter to indicate whether the wait should be declared
      in the thread pool.
      
      buf_flush_wait(): The callers have already declared a wait, so let us
      avoid doing that again, just call os_aio_wait_until_pending_writes(false).
      
      buf_flush_wait_flushed(): Do not declare a wait in the rare case that
      the buf_flush_page_cleaner thread has been shut down already.
      
      buf_flush_page_cleaner(), buf_flush_buffer_pool(): In the code that runs
      during shutdown, do not declare waits.
      
      buf_flush_buffer_pool(): Remove a debug assertion that might fail.
      What really matters here is buf_pool.flush_list.count==0.
      
      buf_read_recv_pages(), srv_prepare_to_delete_redo_log_file():
      Do not declare waits during InnoDB startup.
      0976afec
    • Alexander Barkov's avatar
      A cleanup for MDEV-30968 mariadb-backup does not copy Aria logs if aria_log_dir_path is used · d3e394b3
      Alexander Barkov authored
      Fixing buildbot failures on mariabackup.aria_log_dir_path_rel.
      
      The problem was that directory_exists() was called with the
      relative aria_log_dir_path value, while the current directory
      in mariadb-backup is not necessarily equal to datadir when MTR is running.
      
      Fix:
      
      - Moving building the absolute path un level upper:
        from the function copy_back_aria_logs() to the function copy_back().
      - Passing the built absolute path to both directory_exists() and
        copy_back_aria_logs() as a parameter.
      d3e394b3
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-30996 insert.. select in presence of full text index freezes all other commits at commit time · 2c567b2f
      Thirunarayanan Balathandayuthapani authored
      - This patch does the following:
      git revert --no-commit 673243c8
      git revert --no-commit 6c669b95
      git revert --no-commit bacaf2d4
      git checkout HEAD mysql-test
      git revert --no-commit 1fd7d3a9
      
      Above command reverts MDEV-29277, MDEV-25581, MDEV-29342.
      
      When binlog is enabled, trasaction takes a lot of time to do
      sync operation on innodb fts table. This leads to block
      of other transaction commit. To avoid this failure, remove
      the fulltext sync operation during transaction commit. So
      reverted MDEV-25581 related patches.
      
      We filed MDEV-31105 to avoid the memory consumption
      problem during fulltext sync operation.
      2c567b2f
  7. 22 Apr, 2023 1 commit