Unable to perform Percona MySQL version upgrade to 5.7

I am trying to upgrade my Percona MySQL server to 5.7. The current version on Percona MySQL is 5.6.51-91.0 and the version that I am trying to upgrade is 5.7.40-43. I am performing an in-place upgrade having the following steps:

  • Backup the data and my.cnf file
  • Remove the package of v5.6
  • Install the package of v5.7
  • Executing the mysql_upgrade checker, the upgrade the is getting failed at this point and the error log says:

2023-04-10T18:22:44.763494Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.41-44-log) starting as process 31924 …
2023-04-10T18:22:44.798744Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-04-10T18:22:44.798793Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-04-10T18:22:44.798804Z 0 [Note] InnoDB: Uses event mutexes
2023-04-10T18:22:44.798812Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-04-10T18:22:44.798821Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-04-10T18:22:44.798830Z 0 [Note] InnoDB: Using Linux native AIO
2023-04-10T18:22:44.803122Z 0 [Note] InnoDB: Number of pools: 1
2023-04-10T18:22:44.808970Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-04-10T18:22:44.819849Z 0 [Note] InnoDB: Initializing buffer pool, total size = 300G, instances = 8, chunk size = 128M
2023-04-10T18:22:52.880252Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-04-10T18:22:54.811564Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-04-10T18:22:54.826993Z 0 [Note] InnoDB: Crash recovery did not find the parallel doublewrite buffer at /mysqlData/mysql/data/xb_doublewrite
2023-04-10T18:22:54.829936Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-04-10T18:22:54.830997Z 0 [ERROR] InnoDB: Upgrade after a crash is not supported. This redo log was created before MySQL 5.7.9, and we did not find a valid checkpoint. Please follow the instructions at http://dev.mysql.com/doc/refman/5.7/en/upgrading.html
2023-04-10T18:22:54.831036Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2023-04-10T18:22:59.936051Z 0 [ERROR] Plugin ‘InnoDB’ init function returned error.
2023-04-10T18:22:59.936100Z 0 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
2023-04-10T18:22:59.936173Z 0 [ERROR] Failed to initialize builtin plugins.
2023-04-10T18:22:59.936184Z 0 [ERROR] Aborting

I also found that the parameter innodb_log_block_size is replaced now with innodb_log_write_ahead_size in v5.7 so I made those changes as well in the my.cnf file but it’s not working and making the database crash. Below is the my.cnf :
[client]
socket=/mysqlData/mysql/mysql.sock

[mysqld]
#require_secure_transport=ON

#Settings related to Teleport configuration
ssl-cert=/etc/teleport/va-db-replica-015.crt
ssl-key=/etc/teleport/va-db-replica-015.key
ssl-ca=/etc/teleport/va-db-replica-015.cas

#default-time-zone=EST5EDT

datadir=/mysqlData/mysql/data
socket=/mysqlData/mysql/mysql.sock
max_connections=4000

Key buffer size is used for MyISAM table, hence disabling the same

#key_buffer_size=32M
sort_buffer_size=64M
read_buffer_size=64M
join_buffer_size=64M

table_open_cache=4096
thread_cache_size=500

connect_timeout=60
wait_timeout=600
interactive_timeout=120

open_files_limit=40000
innodb_open_files=800

event_scheduler=OFF

max_allowed_packet=128M
tmp_table_size=1G
max_heap_table_size=1G

#######################

SLAVE SETTINGS

#######################
#log-slave-updates

skip-slave-start
#slave-skip-errors=1062, 1032
#skip-slave-start
read-only

server-id=577
report-host=va-db-replica-015

log-bin=/mysqlData/mysqlbinlog/va-db-replica-015-binlog
relay-log=/mysqlData/mysqlbinlog/va-db-replica-015-relay-bin
#slave_compressed_protocol=1

binlog_format=ROW
expire_logs_days=1
#auto-increment-increment=2
#auto-increment-offset=1

#######################

QUERY CACHE is deprecated from MySQL version 5.6

#######################
#query_cache_size=0
#query_cache_type=1
#query_cache_strip_comments=1

skip-name-resolve

#######################

LOGS

#######################
log_error=/mysqlData/log/mysqld.log
#slow_query_log_file=/mysqlData/log/slow.log
#slow_query_log=OFF
#slow_launch_time=1
#log_queries_not_using_indexes=1
#long_query_time=10
#log_slow_verbosity=fu

#query_response_time_stats=ON

#######################

Innodb Performance

#######################
#innodb_force_recovery=0
innodb_file_per_table
innodb_buffer_pool_size=300G
#innodb_additional_mem_pool_size=20M
innodb_data_file_path = ibdata1:1024M:autoextend
innodb_flush_method=O_DIRECT
innodb_log_file_size=1G
innodb_flush_log_at_trx_commit=2

Dynamic

innodb_io_capacity=500

Dynamic

innodb_concurrency_tickets=4000

innodb_read_io_threads=40
innodb_write_io_threads=30

#Controls the number of background threads used by the InnoDB storage engine to perform purging and garbage collection of old data from the database.
innodb_purge_threads=4

#innodb_flush_neighbor_pages=none
#innodb_adaptive_flushing_method=keep_average

#Transaction related parameters that are dynamic
#innodb_log_block_size=8192
#innodb_log_block_size has been replaced by innodb_log_write_ahead_size variable in v5.7.
innodb_log_write_ahead_size=8192
innodb_log_buffer_size=1G

explicit_defaults_for_timestamp=1

Let InnoDB uses an adaptive algorithm to determine the optimal number of threads based on the available system resources and workload - Dynamic

#innodb_thread_concurrency=0

wait longer for client to read - Dynamic

innodb_sync_spin_loops=30

Disabling the below parameter as the working set of data may go beyond 300G so we will let InnoDB storage engine dynamically load data into the buffer pool as needed

innodb_buffer_pool_populate=0

[mysqld_safe]
err-log=/mysqlData/log/mysqld.log

#######################

NUMA READY SYSTEM / PERCONA SERVER 5.5+

#######################
flush_caches=1
numa_interleave=1

Can someone help me here please?

Note: I did the upgrade with database schemas without data and keeping the default my.cnf and it worked without any issues so I believe the issue is something related to the parameters changes.

2023-04-10T18:22:54.830997Z 0 [ERROR] InnoDB: Upgrade after a crash is not supported. This redo log was created before MySQL 5.7.9, and we did not find a valid checkpoint.

If you know your 5.6 shut down cleanly, then you should remove the InnoDB redo logs (ib_logfile0, ib_logfile1) and let 5.7 create new ones. DO NOT DELETE ibdata1!!!

before upgrading binaries to 5.7 , you should do a “slow_shutdown” just in case
set global innodb_fast_shutdown = 0; and then stop the 5.6 mysql server.
reference: https://dev.mysql.com/doc/refman/5.7/en/server-shutdown.html

Also as Matthew suggested, do not touch/modify the redo logs and let MySQL itself handle the modifications

Regards

I did performed a slow shutdown and removed the redo logs as Matthew suggested. I started the upgrade again and found the following in the error logs :

2023-04-11T15:49:09.612940Z 0 [Warning] Could not increase number of max_open_files to more than 5000 (request: 40000)
2023-04-11T15:49:09.622196Z 0 [Warning] Changed limits: table_open_cache: 495 (requested 4096)
2023-04-11T15:49:09.823756Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.40-43-log) starting as process 38042 …
2023-04-11T15:49:09.855689Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-04-11T15:49:09.855745Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-04-11T15:49:09.855755Z 0 [Note] InnoDB: Uses event mutexes
2023-04-11T15:49:09.855763Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-04-11T15:49:09.855771Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-04-11T15:49:09.855782Z 0 [Note] InnoDB: Using Linux native AIO
2023-04-11T15:49:09.860148Z 0 [Note] InnoDB: Number of pools: 1
2023-04-11T15:49:09.870154Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-04-11T15:49:09.881608Z 0 [Note] InnoDB: Initializing buffer pool, total size = 300G, instances = 8, chunk size = 128M
2023-04-11T15:49:18.228082Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-04-11T15:49:20.210871Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-04-11T15:49:20.224403Z 0 [Note] InnoDB: Crash recovery did not find the parallel doublewrite buffer at /mysqlData/mysql/data/xb_doublewrite
2023-04-11T15:49:20.224827Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 1024 MB
2023-04-11T15:49:20.225436Z 0 [Note] InnoDB: Progress in MB:
100 200 300 400 500 600 700 800 900 1000
2023-04-11T15:49:21.005893Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 1024 MB
2023-04-11T15:49:21.006834Z 0 [Note] InnoDB: Progress in MB:
100 200 300 400 500 600 700 800 900 1000
2023-04-11T15:49:22.265019Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2023-04-11T15:49:22.265173Z 0 [Warning] InnoDB: New log files created, LSN=1129178559769639
2023-04-11T15:49:22.265984Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-04-11T15:49:23.724381Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 1129178559770124
2023-04-11T15:49:23.724425Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 1129178559770133
2023-04-11T15:49:23.724431Z 0 [Note] InnoDB: Database was not shutdown normally!
2023-04-11T15:49:23.724435Z 0 [Note] InnoDB: Starting crash recovery.
2023-04-11T15:49:23.749197Z 0 [Note] InnoDB: Created parallel doublewrite buffer at /mysqlData/mysql/data/xb_doublewrite, size 31457280 bytes
2023-04-11T15:49:24.149004Z 0 [Note] InnoDB: pre-5.7.2 rseg: 1 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.150783Z 0 [Note] InnoDB: pre-5.7.2 rseg: 8 holds data to be purged. History length: 2. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.151501Z 0 [Note] InnoDB: pre-5.7.2 rseg: 9 holds data to be purged. History length: 2. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.152381Z 0 [Note] InnoDB: pre-5.7.2 rseg: 11 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.153282Z 0 [Note] InnoDB: pre-5.7.2 rseg: 13 holds data to be purged. History length: 2. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.153908Z 0 [Note] InnoDB: pre-5.7.2 rseg: 14 holds data to be purged. History length: 3. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.154694Z 0 [Note] InnoDB: pre-5.7.2 rseg: 15 holds data to be purged. History length: 2. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.155449Z 0 [Note] InnoDB: pre-5.7.2 rseg: 16 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.156180Z 0 [Note] InnoDB: pre-5.7.2 rseg: 18 holds data to be purged. History length: 20. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.156863Z 0 [Note] InnoDB: pre-5.7.2 rseg: 19 holds data to be purged. History length: 18. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.158410Z 0 [Note] InnoDB: pre-5.7.2 rseg: 22 holds data to be purged. History length: 3. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.159108Z 0 [Note] InnoDB: pre-5.7.2 rseg: 23 holds data to be purged. History length: 2. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.159807Z 0 [Note] InnoDB: pre-5.7.2 rseg: 24 holds data to be purged. History length: 17. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.160440Z 0 [Note] InnoDB: pre-5.7.2 rseg: 25 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.161192Z 0 [Note] InnoDB: pre-5.7.2 rseg: 26 holds data to be purged. History length: 3. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.162006Z 0 [Note] InnoDB: pre-5.7.2 rseg: 28 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.162695Z 0 [Note] InnoDB: pre-5.7.2 rseg: 29 holds data to be purged. History length: 8. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.163447Z 0 [Note] InnoDB: pre-5.7.2 rseg: 30 holds data to be purged. History length: 18. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.164090Z 0 [Note] InnoDB: pre-5.7.2 rseg: 31 holds data to be purged. History length: 1. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:24.164740Z 0 [Note] InnoDB: pre-5.7.2 rseg: 32 holds data to be purged. History length: 17. Recommend slow shutdown with innodb_fast_shutdown=0 and restart
2023-04-11T15:49:26.796083Z 0 [Note] InnoDB: Last MySQL binlog file position 0 239022932, file name /data/mysqlbinlog/va-db02-binlog.001308
2023-04-11T15:49:27.508567Z 0 [Note] InnoDB: Successfully reset 12 pre-5.7.2 rseg slots.
2023-04-11T15:49:27.508931Z 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2023-04-11T15:49:27.508949Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-04-11T15:49:27.509020Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2023-04-11T15:49:27.517697Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2023-04-11T15:49:27.519548Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-04-11T15:49:27.519569Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-04-11T15:49:27.519714Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 7309ms. The settings might not be optimal. (flushed=0, during the time.)
2023-04-11T15:49:27.519789Z 0 [Note] InnoDB: Creating sys_virtual system tables.
2023-04-11T15:49:27.524743Z 0 [Note] InnoDB: sys_virtual table created
2023-04-11T15:49:27.526506Z 0 [Note] InnoDB: Waiting for purge to start
2023-04-11T15:49:27.576627Z 0 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.40-43 started; log sequence number 1129178559770133
2023-04-11T15:49:27.576865Z 0 [Note] InnoDB: Loading buffer pool(s) from /mysqlData/mysql/data/ib_buffer_pool
2023-04-11T15:49:27.576932Z 0 [ERROR] InnoDB: Cannot open ‘/mysqlData/mysql/data/ib_buffer_pool’ for reading: No such file or directory
2023-04-11T15:49:27.577130Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
2023-04-11T15:49:27.589502Z 0 [Warning] System table ‘plugin’ is expected to be transactional.
2023-04-11T15:49:27.590607Z 0 [ERROR] unknown variable ‘innodb_buffer_pool_populate=0’
2023-04-11T15:49:27.590624Z 0 [ERROR] Aborting

2023-04-11T15:49:27.590663Z 0 [Note] Binlog end
2023-04-11T15:49:27.590751Z 0 [Note] Shutting down plugin ‘ngram’
2023-04-11T15:49:27.590760Z 0 [Note] Shutting down plugin ‘partition’
2023-04-11T15:49:27.590763Z 0 [Note] Shutting down plugin ‘BLACKHOLE’
2023-04-11T15:49:27.590775Z 0 [Note] Shutting down plugin ‘ARCHIVE’
2023-04-11T15:49:27.590779Z 0 [Note] Shutting down plugin ‘INNODB_TABLESPACES_SCRUBBING’
2023-04-11T15:49:27.590782Z 0 [Note] Shutting down plugin ‘INNODB_TABLESPACES_ENCRYPTION’
2023-04-11T15:49:27.590784Z 0 [Note] Shutting down plugin ‘INNODB_SYS_VIRTUAL’
2023-04-11T15:49:27.590787Z 0 [Note] Shutting down plugin ‘INNODB_CHANGED_PAGES’
2023-04-11T15:49:27.590790Z 0 [Note] Shutting down plugin ‘INNODB_SYS_DATAFILES’
2023-04-11T15:49:27.590793Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESPACES’
2023-04-11T15:49:27.590795Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN_COLS’
2023-04-11T15:49:27.590798Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FOREIGN’
2023-04-11T15:49:27.590801Z 0 [Note] Shutting down plugin ‘INNODB_SYS_FIELDS’
2023-04-11T15:49:27.590804Z 0 [Note] Shutting down plugin ‘INNODB_SYS_COLUMNS’
2023-04-11T15:49:27.590807Z 0 [Note] Shutting down plugin ‘INNODB_SYS_INDEXES’
2023-04-11T15:49:27.590809Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLESTATS’
2023-04-11T15:49:27.590812Z 0 [Note] Shutting down plugin ‘INNODB_SYS_TABLES’
2023-04-11T15:49:27.590815Z 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_TABLE’
2023-04-11T15:49:27.590818Z 0 [Note] Shutting down plugin ‘INNODB_FT_INDEX_CACHE’
2023-04-11T15:49:27.590820Z 0 [Note] Shutting down plugin ‘INNODB_FT_CONFIG’
2023-04-11T15:49:27.590823Z 0 [Note] Shutting down plugin ‘INNODB_FT_BEING_DELETED’
2023-04-11T15:49:27.590826Z 0 [Note] Shutting down plugin ‘INNODB_FT_DELETED’
2023-04-11T15:49:27.590828Z 0 [Note] Shutting down plugin ‘INNODB_FT_DEFAULT_STOPWORD’
2023-04-11T15:49:27.590831Z 0 [Note] Shutting down plugin ‘INNODB_METRICS’
2023-04-11T15:49:27.590834Z 0 [Note] Shutting down plugin ‘INNODB_TEMP_TABLE_INFO’
2023-04-11T15:49:27.590837Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_POOL_STATS’
2023-04-11T15:49:27.590839Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE_LRU’
2023-04-11T15:49:27.590842Z 0 [Note] Shutting down plugin ‘INNODB_BUFFER_PAGE’
2023-04-11T15:49:27.590845Z 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX_RESET’
2023-04-11T15:49:27.590848Z 0 [Note] Shutting down plugin ‘INNODB_CMP_PER_INDEX’
2023-04-11T15:49:27.590850Z 0 [Note] Shutting down plugin ‘INNODB_CMPMEM_RESET’
2023-04-11T15:49:27.590853Z 0 [Note] Shutting down plugin ‘INNODB_CMPMEM’
2023-04-11T15:49:27.590856Z 0 [Note] Shutting down plugin ‘INNODB_CMP_RESET’
2023-04-11T15:49:27.590858Z 0 [Note] Shutting down plugin ‘INNODB_CMP’
2023-04-11T15:49:27.590861Z 0 [Note] Shutting down plugin ‘INNODB_LOCK_WAITS’
2023-04-11T15:49:27.590864Z 0 [Note] Shutting down plugin ‘INNODB_LOCKS’
2023-04-11T15:49:27.590867Z 0 [Note] Shutting down plugin ‘INNODB_TRX’
2023-04-11T15:49:27.590869Z 0 [Note] Shutting down plugin ‘XTRADB_ZIP_DICT_COLS’
2023-04-11T15:49:27.590872Z 0 [Note] Shutting down plugin ‘XTRADB_ZIP_DICT’
2023-04-11T15:49:27.590875Z 0 [Note] Shutting down plugin ‘XTRADB_RSEG’
2023-04-11T15:49:27.590878Z 0 [Note] Shutting down plugin ‘XTRADB_INTERNAL_HASH_TABLES’
2023-04-11T15:49:27.590880Z 0 [Note] Shutting down plugin ‘XTRADB_READ_VIEW’
2023-04-11T15:49:27.590883Z 0 [Note] Shutting down plugin ‘InnoDB’
2023-04-11T15:49:27.590947Z 0 [Note] InnoDB: FTS optimize thread exiting.
2023-04-11T15:49:27.591065Z 0 [Note] InnoDB: Starting shutdown…
2023-04-11T15:49:27.691269Z 0 [Note] InnoDB: Dumping buffer pool(s) to /mysqlData/mysql/data/ib_buffer_pool
2023-04-11T15:49:27.691582Z 0 [Note] InnoDB: Buffer pool(s) dump completed at 230411 11:49:27
2023-04-11T15:49:28.692196Z 0 [Note] InnoDB: Waiting for page_cleaner to finish flushing of buffer pool
2023-04-11T15:49:33.442952Z 0 [Note] InnoDB: Shutdown completed; log sequence number 1129178559795442
2023-04-11T15:49:33.443108Z 0 [Note] InnoDB: Removed temporary tablespace data file: “ibtmp1”
2023-04-11T15:49:33.443139Z 0 [Note] Shutting down plugin ‘MEMORY’
2023-04-11T15:49:33.443145Z 0 [Note] Shutting down plugin ‘MRG_MYISAM’
2023-04-11T15:49:33.443161Z 0 [Note] Shutting down plugin ‘CSV’
2023-04-11T15:49:33.443167Z 0 [Note] Shutting down plugin ‘MyISAM’
2023-04-11T15:49:33.443185Z 0 [Note] Shutting down plugin ‘PERFORMANCE_SCHEMA’
2023-04-11T15:49:33.443255Z 0 [Note] Shutting down plugin ‘sha256_password’
2023-04-11T15:49:33.443258Z 0 [Note] Shutting down plugin ‘mysql_native_password’
2023-04-11T15:49:33.443460Z 0 [Note] Shutting down plugin ‘binlog’
2023-04-11T15:49:33.443646Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

2023-04-11T15:49:34.188435Z 0 [Warning] Could not increase number of max_open_files to more than 5000 (request: 40000)
2023-04-11T15:49:34.195301Z 0 [Warning] Changed limits: table_open_cache: 495 (requested 4096)
2023-04-11T15:49:34.374386Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.40-43-log) starting as process 38199 …
2023-04-11T15:49:34.386321Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-04-11T15:49:34.386352Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-04-11T15:49:34.386357Z 0 [Note] InnoDB: Uses event mutexes
2023-04-11T15:49:34.386362Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-04-11T15:49:34.386366Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.12
2023-04-11T15:49:34.386370Z 0 [Note] InnoDB: Using Linux native AIO
2023-04-11T15:49:34.388656Z 0 [Note] InnoDB: Number of pools: 1
2023-04-11T15:49:34.398373Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-04-11T15:49:34.408443Z 0 [Note] InnoDB: Initializing buffer pool, total size = 300G, instances = 8, chunk size = 128M
2023-04-11T15:49:42.595796Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-04-11T15:49:44.528127Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-04-11T15:49:44.541628Z 0 [Note] InnoDB: Crash recovery did not find the parallel doublewrite buffer at /mysqlData/mysql/data/xb_doublewrite
2023-04-11T15:49:44.542773Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-04-11T15:49:46.229496Z 0 [Note] InnoDB: Created parallel doublewrite buffer at /mysqlData/mysql/data/xb_doublewrite, size 31457280 bytes
2023-04-11T15:49:49.007051Z 0 [Note] InnoDB: Successfully reset 20 pre-5.7.2 rseg slots.
2023-04-11T15:49:49.007099Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-04-11T15:49:49.007145Z 0 [Note] InnoDB: Setting file ‘./ibtmp1’ size to 12 MB. Physically writing the file full; Please wait …
2023-04-11T15:49:49.013591Z 0 [Note] InnoDB: File ‘./ibtmp1’ size is now 12 MB.
2023-04-11T15:49:49.014330Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-04-11T15:49:49.014340Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-04-11T15:49:49.014465Z 0 [Note] InnoDB: page_cleaner: 1000ms intended loop took 4487ms. The settings might not be optimal. (flushed=0, during the time.)
2023-04-11T15:49:49.015672Z 0 [Note] InnoDB: Waiting for purge to start
2023-04-11T15:49:49.066026Z 0 [Note] InnoDB: Percona XtraDB (http://www.percona.com) 5.7.40-43 started; log sequence number 1129178559795442
2023-04-11T15:49:49.066739Z 0 [Note] InnoDB: Loading buffer pool(s) from /mysqlData/mysql/data/ib_buffer_pool
2023-04-11T15:49:49.066974Z 0 [Note] Plugin ‘FEDERATED’ is disabled.
2023-04-11T15:49:49.073320Z 0 [Warning] System table ‘plugin’ is expected to be transactional.
2023-04-11T15:49:49.073848Z 0 [ERROR] unknown variable ‘innodb_buffer_pool_populate=0’
2023-04-11T15:49:49.073865Z 0 [ERROR] Aborting

I did commented out the parameter innodb_buffer_pool_populate in the my.cnf file and tried starting the service and this time the service got started.

I executed the mysql_upgrade checker utility to check for any discrepancies and what I noticed is that the mysql tables are all good, however for many application tables I am getting error message : error : Table rebuild required. Please do “ALTER TABLE AccessLevel FORCE” or dump/reload to fix it! :

mysql_upgrade -u root -p
Enter password:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
mysql.db OK
mysql.engine_cost OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
mysql.user_info OK
Upgrading the sys schema.
Checking databases.
dbname.AccessLevel
error : Table rebuild required. Please do “ALTER TABLE AccessLevel FORCE” or dump/reload to fix it!
dbname.Action
error : Table rebuild required. Please do “ALTER TABLE Action FORCE” or dump/reload to fix it!
dbname.ActionConversion
error : Table rebuild required. Please do “ALTER TABLE ActionConversion FORCE” or dump/reload to fix it!
dbname.ActionPageGroupMapping
error : Table rebuild required. Please do “ALTER TABLE ActionPageGroupMapping FORCE” or dump/reload to fix it!

We have 1000+ tables and this issue is with ~30% of the tables. Any suggestions on this ?

Hi again,

Please take a look at this blogpost: A Little Trick Upgrading to MySQL 5.7

You will need to rebuild all the tables

Regards

Thank you for your assistance @CTutte and @matthewb , I will go through the same and update here with the end result.

Hi Carlos,

I referred the article : https://www.percona.com/blog/little-trick-upgrading-mysql-5-7/ and tried the mysqlcheck --check-upgrade --all-databases > mysql-check.log, however, the list shows me that majority of the tables requires rebuild. Now this seems weird because I have created the replicas that are up and running using the same data that I used on the staging environment then why it is asking me to do a table repair.

I am looking for a way wherein the these tables repair can be avoided because our database size is ~700G and it took me ~5 hours when I had kept the mysql_upgrade running as it is.

Any help is appreciated.

There are on-disk changes between 5.6 and 5.7. It is not required to rebuild them, but it is best practice to get optimal performance out of MySQL.

Hi Matthew,

How do I skip the rebuild part then as mysql_upgrade checker utility does it automatically which checking for any incompatibilities.

Check --help. There is an option to only process system tables.

Thank you for your help Matthew :slight_smile: , I used the flag : --upgrade-system-tables with mysql_upgrade and it worked well. The --upgrade-system-tables option tells mysql_upgrade to upgrade only the system tables and skip the application tables.

Now that you are on 5.7, you need to schedule time to actually fix all those tables so that you can be ready for MySQL 8. Remember, 5.7 EOL in Oct’23

Hi Matthew, I don’t understand why did we get the error ==> error : Table rebuild required. Please do “ALTER TABLE tablename FORCE” or dump/reload to fix it! I am trying to understand the root cause for this error. Also, what if I am not rebuilding those, will I not be able to upgrade to MySQL 8 ? The reason why I am asking this is because the tables are working well in the current MySQL 5.6 version.

@MahendraB,
You got the error because, as I said above, there are on-disk format changes between 5.6 and 5.7. Yes, your old 5.6-format will work in 5.7 but it won’t be optimal. No, you won’t be able to upgrade to 8 until you “upgrade” the tables to the 5.7 format.
Look at using pt-online-schema-change to accomplish this.

Thanks again Matthew, much appreciated. I will go through the options for this.