1. 08 Aug, 2024 1 commit
  2. 03 Aug, 2024 1 commit
    • mariadb-DebarunBanerjee's avatar
      MDEV-34689 Redo log corruption at high load · e515e807
      mariadb-DebarunBanerjee authored
      Issue: During mtr_t:commit, if there is not enough space available in
      redo log buffer, we flush the buffer. During flush, the LSN lock is
      released allowing other concurrent mtr to commit. After flush we
      reacquire the lock but use the old LSN obtained before check. It could
      lead to redo log corruption. As the LSN moves backwards with the
      possibility of data loss and unrecoverable server if the server aborts
      for any reason or if server is shutdown with innodb_fast_shutdown=2.
      With normal shutdown, recovery fails to map the checkpoint LSN to
      correct offset.
      
      In debug mode it hits log0log.cc:863: lsn_t log_t::write_buf()
      Assertion `new_buf_free == ((lsn - first_lsn) & write_size_1)' failed.
      
      In release mode, after normal shutdown, restart fails.
      [ERROR] InnoDB: Missing FILE_CHECKPOINT(8416546) at 8416546
      [ERROR] InnoDB: Log scan aborted at LSN 8416546
      
      Backup fails reading the corrupt redo log.
      [00] 2024-07-31 20:59:10 Retrying read of log at LSN=7334851
      [00] FATAL ERROR: 2024-07-31 20:59:11 Was only able to copy log from
      7334851 to 7334851, not 8416446; try increasing innodb_log_file_size
      
      Unless a backup is tried or the server is shutdown or killed
      immediately, the corrupt redo part is eventually truncated and there
      may not be any visible issues seen in release mode.
      
      This issue was introduced by the following commit.
      
      commit a635c406
          MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit()
      
      Fix: If we need to release latch and flush redo before writing mtr
      logs, make sure to get the latest system LSN after reacquiring the
      redo system latch.
      e515e807
  3. 02 Aug, 2024 1 commit
  4. 30 Jul, 2024 2 commits
    • Marko Mäkelä's avatar
      MDEV-34422 Corrupted ib_logfile0 due to uninitialized log_sys.lsn_lock · 1c8af2ae
      Marko Mäkelä authored
      In commit bf0b82d2 (MDEV-33515)
      the function log_t::init_lsn_lock() was removed. This was fine on
      those platforms where InnoDB uses futex-based mutexes (Linux, FreeBSD,
      OpenBSD, NetBSD, DragonflyBSD).
      
      Dave Gosselin debugged this on Apple macOS and submitted a fix where
      pthread_mutex_wrapper::pthread_mutex_wrapper() would invoke init().
      We do not really need that; we only need to invoke lsn_lock.init()
      like we used to do before commit bf0b82d2.
      This should be a no-op for the futex based mutexes, which intentionally
      rely on zero initialization.
      
      The missing pthread_mutex_init() call would cause race conditions
      and corruption of log_sys.buf because multiple threads could
      apparently hold log_sys.lsn_lock concurrently in
      log_t::append_prepare().  The error would be caught by a debug
      assertion in log_t::write_buf(), or in non-debug builds by the
      fact that the server cannot be restarted due to an apparently
      missing FILE_CHECKPOINT record (because it had been written
      to wrong offset in log_sys.buf).
      
      The failure in log_t::append_prepare() was caught on Microsoft Windows
      after enabling SUX_LOCK_GENERIC and therefore forcing the use of
      pthread_mutex_wrapper for the log_sys.lsn_lock.  It appears to be fine
      to omit the pthread_mutex_init() call on GNU/Linux.
      
      log_t::create(): Invoke lsn_lock.init().
      
      log_t::close(): Invoke lsn_lock.destroy().
      
      To better catch this kind of issues in the future by simply defining
      SUX_LOCK_GENERIC on any platform, a separate debug instrumentation patch
      will be applied to the 10.6 branch later.
      
      Reviewed by: Debarun Banerjee
      1c8af2ae
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-33087 ALTER TABLE...ALGORITHM=COPY should build indexes more efficiently · cc8eefb0
      Thirunarayanan Balathandayuthapani authored
      - During copy algorithm, InnoDB should use bulk insert operation
      for row by row insert operation. By doing this, copy algorithm
      can effectively build indexes. This optimization is disabled
      for temporary table, versioning table and table which has
      foreign key relation.
      
      Introduced the variable innodb_alter_copy_bulk to allow
      the bulk insert operation for copy alter operation
      inside InnoDB. This is enabled by default
      
      ha_innobase::extra(): HA_EXTRA_END_ALTER_COPY mode tries to apply
      the buffered bulk insert operation, updates the non-persistent
      table stats.
      
      row_merge_bulk_t::write_to_index(): Update stat_n_rows after
      applying the bulk insert operation
      
      row_ins_clust_index_entry_low(): In case of copy algorithm,
      switch to bulk insert operation.
      
      copy_data_error_ignore(): Handles the error while copying
      the data from source to target file.
      cc8eefb0
  5. 24 Jul, 2024 1 commit
  6. 22 Jul, 2024 2 commits
  7. 20 Jul, 2024 1 commit
  8. 19 Jul, 2024 4 commits
    • Andrei's avatar
      MDEV-15393 gtid_slave_pos duplicate key errors after mysqldump restore · b8f92ade
      Andrei authored
      When mysqldump is run to dump the `mysql` system database, it generates
      INSERT statements into the table `mysql.gtid_slave_pos`.
      After running the backup script
      those inserts did not produce the expected gtid state on slave. In
      particular the maximum of mysql.gtid_slave_pos.sub_id did not make
      into
         rpl_global_gtid_slave_state.last_sub_id
      
      an in-memory object that is supposed to match the current state of the
      table. And that was regardless of whether --gtid option was specified
      or not. Later when the backup recipient server starts as slave
      in *non-gtid* mode this desychronization may lead to a duplicate key
      error.
      
      This effect is corrected for --gtid mode mysqldump/mariadb-dump only
      as the following.  The fixes ensure the insert block of the dump
      script is followed with a "summing-up" SET @global.gtid_slave_pos
      assignment.
      
      For the implemenation part, note a deferred print-out of
      SET-gtid_slave_pos and associated comments is prefered over relocating
      of the entire blocks if (opt_master,slave_data &&
      do_show_master,slave_status) ...  because of compatiblity
      concern. Namely an error inside do_show_*() is handled in the new code
      the same way, as early as, as before.
      
      A regression test can be run in how-to-reproduce mode as well.
      One affected mtr test observed.
      rpl_mysqldump_slave.result "mismatch" shows now the new deferring print
      of SET-gtid_slave_pos policy in action.
      b8f92ade
    • Oleksandr Byelkin's avatar
      new libfmt 11.0.1 · 0f6f1114
      Oleksandr Byelkin authored
      0f6f1114
    • Oleksandr Byelkin's avatar
      New CC 3.3 · a94fd874
      Oleksandr Byelkin authored
      a94fd874
    • Oleksandr Byelkin's avatar
      Fix view protocol · b8b6cab2
      Oleksandr Byelkin authored
      b8b6cab2
  9. 18 Jul, 2024 2 commits
  10. 17 Jul, 2024 25 commits
    • Brandon Nesterenko's avatar
      MDEV-33921: Fix rpl_xa_empty_transaction.test · a061ae10
      Brandon Nesterenko authored
      The test was missing a save_master_gtid.inc on the master,
      leading to the slave thinking it was in sync after executing
      sync_with_master_gtid.inc, despite not having executed the
      latest transaction. This skipped transaction, XA COMMIT,
      was supposed to error-to-be-ignored because its XID could not
      be found, but be thrown out because the replication filters
      would filter out the target database. However, if the slave
      was able to stop before executing the transaction, then
      the replication filer is reset (to empty), and when the
      slave is later restarted, that transactions error would
      no longer be ignored.
      
      Additionally, as the test cases added in MDEV-33921 rely
      on GTID synchronization, the test cases now force
      master_use_gtid=slave_pos for consistency
      a061ae10
    • Sergei Golubchik's avatar
      MDEV-34353 Revert "don't wait indefinitely for signal handler in --bootstrap" · 36b867ad
      Sergei Golubchik authored
      This reverts commit 938b9293. Not needed after 90d376e0.
      36b867ad
    • Sergei Golubchik's avatar
      MDEV-34539 Invalid "use" and "Schema" in slow query log file with multi-line schema · 8d813f08
      Sergei Golubchik authored
      quote a database name in the slow log
      8d813f08
    • Sergei Golubchik's avatar
      MDEV-34530 dead code in the thr_rwlock.c · f12634f5
      Sergei Golubchik authored
      remove it
      f12634f5
    • Sergei Golubchik's avatar
      MDEV-34434 Hide password passed on commandline from xtrabackup_info · 7ba12d42
      Sergei Golubchik authored
      refine mariadb-backup password zapping check
      7ba12d42
    • Sergei Golubchik's avatar
      d2051816
    • Sergei Golubchik's avatar
      MDEV-34318 mariadb-dump SQL syntax error with MAX_STATEMENT_TIME against Percona MySQL server · d60f5c11
      Sergei Golubchik authored
      protect MariaDB conditional comments from a bug
      in Percona MySQL comment parser
      d60f5c11
    • Sergei Golubchik's avatar
      MDEV-32155 MariaDB Server crashes with ill-formed partitions · dea5746d
      Sergei Golubchik authored
      for ALTER_PARTITION_ADMIN (CHECK/REPAIR/LOAD INDEX/CACHE INDEX/etc)
      partitioning marks affected partitions with PART_ADMIN state.
      
      The assumption is that the server will call a corresponding
      method of ha_partition which will reset the state back to PART_NORMAL.
      
      This assumption is invalid, the server is not required to do so,
      indeed, in CHECK ... FOR UPGRADE the server might decide early that
      the table is fine and won't call ha_partition::check(), leaving
      partitions in the wrong state. It will thus leak into the next
      statement confusing the engine about what it is doing (see
      ha_partition::create_handler_file()), causing a crash later.
      
      Let's force all partitions into PART_NORMAL state after the admin
      operation succeeded, in case it did so without consulting the engine.
      dea5746d
    • Sergei Golubchik's avatar
    • Rucha Deodhar's avatar
      MDEV-32456: incorrect result of gis function in view protocol · 1f28350b
      Rucha Deodhar authored
      There are 3 diff in result:
      1) NULL value from SELECT
      Due to incorrect truncating of the hex value, incorrect value is
      written instead of original value to the view frm. This results in reading
      incorrect value from frm, so eventual result is NULL.
      2) 'Name_exp1' in column name (in gis.test)
      This was because the identifier in SELECT is longer than 64 characters,
      so 'Name_exp1' alias is also written to the view frm.
      3)diff in explain extended
      This was because the query plan for view protocol doesn't
      contain database name. As a fix, disable view protocol for that particular
      query.
      1f28350b
    • Souradeep Saha's avatar
      Refactor import * with only required imports · 4a89f79b
      Souradeep Saha authored
      Import only the required functions instead of all the functions from the
      module to reduce the unnecessary functions in the namespace and prevent
      shadowing. Note: All code changes are non-functional.
      
      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.
      4a89f79b
    • Robin Newhouse's avatar
      GitLab CI Upgrade CentOS 8 to CentOS 9 build · 008bddaa
      Robin Newhouse authored
      > After May 31, 2024, CentOS Stream 8 will be archived and no further
      updates will be provided. [1]
      
      CentOS Stream 8 is now EOL and should be updated to using CentOS Stream
      9 for compatibility testing in GitLab CI.
      
      [1] https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/
      https://www.centos.org/centos-linux-eol/
      
      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.
      008bddaa
    • Oleksandr Byelkin's avatar
      new CC version · e7c2e25b
      Oleksandr Byelkin authored
      e7c2e25b
    • Oleksandr Byelkin's avatar
      new PCRE2-10.44 · 7478fabc
      Oleksandr Byelkin authored
      7478fabc
    • Alexander Barkov's avatar
      MDEV-28345 ASAN: use-after-poison or unknown-crash in my_strtod_int from... · b777b749
      Alexander Barkov authored
      MDEV-28345 ASAN: use-after-poison or unknown-crash in my_strtod_int from charset_info_st::strntod or test_if_number
      
      This patch fixes two problems:
      
      - The code inside my_strtod_int() in strings/dtoa.c could test the byte
        behind the end of the string when processing the mantissa.
        Rewriting the code to avoid this.
      
      - The code in test_if_number() in sql/sql_analyse.cc called my_atof()
        which is unsafe and makes the called my_strtod_int() look behind
        the end of the string if the input string is not 0-terminated.
        Fixing test_if_number() to use my_strtod() instead, passing the correct
        end pointer.
      b777b749
    • Sutou Kouhei's avatar
      MDEV-21166 Add Mroonga initialized check to Mroonga UDFs · 383d53ed
      Sutou Kouhei authored
      Mroonga UDFs can't be used without loading Mroonga.
      383d53ed
    • Tuukka Pasanen's avatar
      MDEV-33750: Brand some mysql stuff to mariadb · d94f34c1
      Tuukka Pasanen authored
      As is everywhere in mariadbd is used it more than
      convienient to use mariadbd-safe than mysql_safe
      in init script also in upstream test use output
      mariadb-test-run-junit.xml than mysql-test-run-junit.xml
      d94f34c1
    • Tuukka Pasanen's avatar
      MDEV-33750: Conflict with Debian libmariadbd19t64 · c22d01c9
      Tuukka Pasanen authored
      Conflict with Debian package libmariadbd19t64 as it marks
      that package is compliant with 64-bit time and does not
      suffer from year 2038 effect
      c22d01c9
    • Tuukka Pasanen's avatar
      MDEV-33750: Update Salsa-CI file · 91336f6a
      Tuukka Pasanen authored
      Update changes from Debian Salsa that they are
      in sync
      91336f6a
    • Tuukka Pasanen's avatar
      MDEV-33750: Update few Debian Salsa-CI tests from upstream to make smoke test pass · 74aea60d
      Tuukka Pasanen authored
      autopkgtests from package are not passing currently and make them pass with
      upgrading Salsa-CI YAML file.
      74aea60d
    • Tuukka Pasanen's avatar
      MDEV-33750: Sync smoke test from newer version of Debian Salsa-CI · 89a638f4
      Tuukka Pasanen authored
      For making smoke test work sync current Debian Salsa-CI version
      for making needed changes
      89a638f4
    • Tuukka Pasanen's avatar
      MDEV-33750: Remove seq in Debian init.d for-loop · 4c1e4ba6
      Tuukka Pasanen authored
      Make all init.d script for loops to use new
      {1..5} syntax and rework one not to use seq as
      all the rest use new Bash syntax.
      4c1e4ba6
    • Tuukka Pasanen's avatar
      MDEV-33750: Rework MyISAM recovery script · 7ae95051
      Tuukka Pasanen authored
      Make small adjustment to MyISAM recovery function
      SQL statement and how to handle it.
      7ae95051
    • Otto Kekäläinen's avatar
      MDEV-33750: Make SysV init more verbose in case of MariaDB start failures · af124c4f
      Otto Kekäläinen authored
      MariaDB installs/upgrades in Docker containers (and elsewhere where
      systemd is not used) occasionally fail with output like:
      
        Starting MariaDB database server: mariadbd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
        invoke-rc.d: initscript mariadb, action "start" failed.
        dpkg: error processing package mariadb-server-10.5 (--configure):
         installed mariadb-server-10.5 package post-installation script subprocess returned error exit status 1
      
      This is not very helpful. Thus extend the init script to try the server
      start/restart one more time but with error log defined separately,
      and then print out the error log contents of this single start attempt.
      
        ...
        Starting MariaDB database server: mariadbd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        230103 01:06:48 mysqld_safe Can't log to error log and syslog at the same time.  Remove all --log-error configuration options for --syslog to take effect.
        230103 01:06:48 mysqld_safe Logging to '/tmp/tmp.JlE4sdUMZz.err'.
        230103 01:06:49 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
        Running '/etc/init.d/mariadb start' failed with error log:
        230103 01:06:49 mysqld_safe Starting mariadbd daemon with databases from /var/lib/mysql
        2023-01-03  1:06:49 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-0+deb11u1) starting as process 10417 ...
        2023-01-03  1:06:49 0 [Note] InnoDB: Uses event mutexes
        2023-01-03  1:06:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
        2023-01-03  1:06:49 0 [Note] InnoDB: Number of pools: 1
        2023-01-03  1:06:49 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions
        2023-01-03  1:06:49 0 [Note] InnoDB: Using Linux native AIO
        2023-01-03  1:06:49 0 [Note] InnoDB: Initializing buffer pool, total size = 134217728, chunk size = 134217728
        2023-01-03  1:06:49 0 [Note] InnoDB: Completed initialization of buffer pool
        2023-01-03  1:06:49 0 [ERROR] InnoDB: Invalid flags 0x4800 in ./ibdata1
        ...
      af124c4f
    • Otto Kekäläinen's avatar
      MDEV-33750: Make sure that datadir always has some value and exists · 3f44efaa
      Otto Kekäläinen authored
      Adapted from upstream commit 8171f9da but separated only the datadir
      section from the commit and wrote it in a way that does not trigger
      Shellcheck or English grammar nags.
      
      This check is intentionally not added to the preinst script as was done
      upstream in 30fb72ca as the preinst script will always create the
      data directory if missing, and thus checking for it right after the
      creation is moot.
      3f44efaa