Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-25951

MariaDB crash after ALTER TABLE convert to utf8mb4



    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.4.19, 10.5.10, 10.4, 10.5, 10.6
    • 10.4.22, 10.5.13, 10.6.5
    • None
    • OS: CloudLinux like RHEL - Kernel 4.18.0-147.8.1.el8.lve.1.x86_64


      We run rather large production servers with over hundreds of databases with varying sizes between a few MB and many GB.

      Over the past few days we noticed that sometimes MariaDB seems to quit responding on our production servers.

      We found out that this behaviour can be triggered if someone updates their WordPress website. When WordPress is updated it also performs some database queries to convert tables to utf8mb4.

      E.g. the following query is done:

      ALTER TABLE wp_usermeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci

      This causes MariaDB to complete stop responding for about 15 seconds and than recovers.

      This is very unwanted behaviour because customers keep trying to update their website causing MariaDB to not respond multiple times over a short duration.

      The following is logged during the crash:

      2021-06-16 14:46:11 0x7fcc332b3700  InnoDB: Assertion failure in file /builddir/build/BUILD/mariadb-10.4.19/storage/innobase/data/data0type.cc line 67
      InnoDB: Failing assertion: !(prefix_len % mbmaxlen)
      InnoDB: We intentionally generate a memory trap.
      InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
      InnoDB: If you get repeated assertion failures or crashes, even
      InnoDB: immediately after the mysqld startup, there may be
      InnoDB: corruption in the InnoDB tablespace. Please refer to
      InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
      InnoDB: about forcing recovery.
      210616 14:46:11 [ERROR] mysqld got signal 6 ;
      This could be because you hit a bug. It is also possible that this binary
      or one of the libraries it was linked against is corrupt, improperly built,
      or misconfigured. This error can also be caused by malfunctioning hardware.
      To report this bug, see https://mariadb.com/kb/en/reporting-bugs
      We will try our best to scrape up some info that will hopefully help
      diagnose the problem, but since we have already crashed, 
      something is definitely wrong and this may fail.
      Server version: 10.4.19-MariaDB-log-cll-lve
      It is possible that mysqld could use up to 
      key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1106098 K  bytes of memory
      Hope that's ok; if not, decrease some variables in the equation.
      Thread pointer: 0x7fcc0b149388
      Attempting backtrace. You can use the following information to find out
      where mysqld died. If you see no messages after this, something went
      terribly wrong...
      stack_bottom = 0x7fcc332b13d8 thread_stack 0x40000
      Trying to get some variables.
      Some pointers may be invalid and cause the dump to abort.
      Query (0x7fcc02b64c60): ALTER TABLE wp_usermeta CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
      Connection ID (thread ID): 4914
      Status: NOT_KILLED
      Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,m
      The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
      information that should help you find out what is causing the crash.
      Writing a core file...
      Working directory at /var/lib/mysql
      Resource Limits:
      Limit                     Soft Limit           Hard Limit           Units     
      Max cpu time              unlimited            unlimited            seconds   
      Max file size             unlimited            unlimited            bytes     
      Max data size             unlimited            unlimited            bytes     
      Max stack size            8388608              unlimited            bytes     
      Max core file size        unlimited            unlimited            bytes     
      Max resident set          unlimited            unlimited            bytes     
      Max processes             514122               514122               processes 
      Max open files            51200                51200                files     
      Max locked memory         65536                65536                bytes     
      Max address space         unlimited            unlimited            bytes     
      Max file locks            unlimited            unlimited            locks     
      Max pending signals       514122               514122               signals   
      Max msgqueue size         819200               819200               bytes     
      Max nice priority         0                    0                    
      Max realtime priority     0                    0                    
      Max realtime timeout      unlimited            unlimited            us        
      Core pattern: |/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e
      2021-06-16 14:46:18 0 [Warning] You need to use --log-bin to make --binlog-format work.
      2021-06-16 14:46:18 0 [Warning] The parameter innodb_file_format is deprecated and has no effect. It may be removed in future releases. See https://mariadb.com/kb/en/library/xtradbinnodb-file-format/
      2021-06-16 14:46:18 0 [Warning] InnoDB: Setting innodb_checksum_algorithm to values other than crc32, full_crc32, strict_crc32 or strict_full_crc32 is UNSAFE and DEPRECATED. These deprecated values will be disallowed in MariaDB 10.6.
      2021-06-16 14:46:18 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
      2021-06-16 14:46:18 0 [Note] InnoDB: Uses event mutexes
      2021-06-16 14:46:18 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
      2021-06-16 14:46:18 0 [Note] InnoDB: Number of pools: 1
      2021-06-16 14:46:18 0 [Note] InnoDB: Using SSE2 crc32 instructions
      2021-06-16 14:46:18 0 [Note] mysqld: O_TMPFILE is not supported on /var/lib/mysql_tmp (disabling future attempts)
      2021-06-16 14:46:18 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
      2021-06-16 14:46:18 0 [Note] InnoDB: Completed initialization of buffer pool
      2021-06-16 14:46:18 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
      2021-06-16 14:46:18 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=30378586209559
      2021-06-16 14:46:19 0 [Note] InnoDB: Starting final batch to recover 220 pages from redo log.
      2021-06-16 14:46:24 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
      2021-06-16 14:46:24 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
      2021-06-16 14:46:24 0 [Note] InnoDB: Creating shared tablespace for temporary tables
      2021-06-16 14:46:24 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
      2021-06-16 14:46:24 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
      2021-06-16 14:46:24 0 [Note] InnoDB: Waiting for purge to start
      2021-06-16 14:46:24 0 [Note] InnoDB: 10.4.19 started; log sequence number 30378586621666; transaction id 47558113933
      2021-06-16 14:46:24 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
      2021-06-16 14:46:24 0 [Note] Plugin 'FEEDBACK' is disabled.
      2021-06-16 14:46:24 0 [Note] Server socket created on IP: '::'.
      2021-06-16 14:46:24 0 [Note] Reading of all Master_info entries succeeded
      2021-06-16 14:46:24 0 [Note] Added new Master_info '' to hash table
      2021-06-16 14:46:24 0 [Note] /usr/sbin/mysqld: ready for connections.
      Version: '10.4.19-MariaDB-log-cll-lve'  socket: '/var/lib/mysql_sock/mysql.sock'  port: 3306  MariaDB Server
      2021-06-16 14:46:24 0 [Note] InnoDB: Buffer pool(s) load completed at 210616 14:46:24


        Issue Links



              kevg Eugene Kosov (Inactive)
              Joriz Joris de Leeuw
              4 Vote for this issue
              12 Start watching this issue



                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.