We have a (1)master - (6)slave setup, which the master server crashes for about 5 times a day. It appears to be quite random that it does not always crash at the highest load. Sometimes it crashes at off-peak hours. The slave never crashes.
Looked at the mysql log, it appears to be some very normal SELECT query at the time of crash.
SELECT user_auth.*, DATE(user_auth.premium_expire_date) AS premium_expire_date FROM user_auth WHERE user_auth.fub_id_people = '31763'
I am clueless here, which way should I look to find the cause of crashes?
The red arrows are when crash happened.
- Host: 8 core 16gb Centos 7.6
- Percona mysql 8.0.22-13 (I upgraded to the latest version)
- Size of database: 12gb
- The load on master is light, CPU never exceed 40%.
- no. of queries ranging from 200 ~ 790 at the time crash happens. There is no clear pattern that crash is related to load.
mysqld.cnf
[mysqld]
lower_case_table_names=1
event_scheduler=ON
innodb_file_per_table=ON
innodb_ft_min_token_size = 1
innodb_ft_enable_stopword =OFF
innodb_ft_server_stopword_table=realagent_prd/_index_stopword
innodb_buffer_pool_size = 10240M
innodb_buffer_pool_instances = 5
log_bin = mysql-bin
server-id = 1
binlog_do_db = realagent_prd
binlog_expire_logs_seconds = 259200
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
symbolic-links=0
log-error=/var/log/mysql/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
The crash logs are very similar each time:
23:22:42 UTC - mysqld got signal 11 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
Build ID: e8de225be5945e9ad0279fcd08607fdf7a4b6c92
Server Version: 8.0.22-13 Percona Server (GPL), Release 13, Revision 6f7822f
Thread pointer: 0x7fd96806c450
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 = 7fdc80052c70 thread_stack 0x46000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x3d) [0x210c1ed]
/usr/sbin/mysqld(handle_fatal_signal+0x3c3) [0x1260d53]
/lib64/libpthread.so.0(+0xf630) [0x7fdcc1e11630]
/usr/sbin/mysqld() [0x23de97d]
/usr/sbin/mysqld(trx_undo_update_rec_get_update(unsigned char const*, dict_index_t const*, unsigned long, unsigned long, unsigned long, unsigned long, trx_t*, mem_block_info_t*, upd_t**, lob::undo_vers_t*, type_cmpl_t&)+0x80b) [0x23e08ab]
/usr/sbin/mysqld(trx_undo_prev_version_build(unsigned char const*, mtr_t*, unsigned char const*, dict_index_t const*, unsigned long*, mem_block_info_t*, unsigned char**, mem_block_info_t*, dtuple_t const**, unsigned long, lob::undo_vers_t*)+0x47b) [0x23e242b]
/usr/sbin/mysqld(row_vers_build_for_consistent_read(unsigned char const*, mtr_t*, dict_index_t*, unsigned long**, ReadView*, mem_block_info_t**, mem_block_info_t*, unsigned char**, dtuple_t const**, lob::undo_vers_t*)+0x25c) [0x2392e2c]
/usr/sbin/mysqld(row_search_mvcc(unsigned char*, page_cur_mode_t, row_prebuilt_t*, unsigned long, unsigned long)+0x38f1) [0x237fa91]
/usr/sbin/mysqld(ha_innobase::general_fetch(unsigned char*, unsigned int, unsigned int)+0x298) [0x21f6448]
/usr/sbin/mysqld(handler::ha_rnd_next(unsigned char*)+0x66) [0xe26b26]
/usr/sbin/mysqld(TableScanIterator::Read()+0x1d) [0x104417d]
/usr/sbin/mysqld(FilterIterator::Read()+0x14) [0x131f214]
/usr/sbin/mysqld(SELECT_LEX_UNIT::ExecuteIteratorQuery(THD*)+0x3e3) [0x11e0793]
/usr/sbin/mysqld(SELECT_LEX_UNIT::execute(THD*)+0x2c) [0x11e097c]
/usr/sbin/mysqld(Sql_cmd_dml::execute_inner(THD*)+0x3cb) [0x1164b6b]
/usr/sbin/mysqld(Sql_cmd_dml::execute(THD*)+0x6c0) [0x116f5b0]
/usr/sbin/mysqld(mysql_execute_command(THD*, bool)+0xaf8) [0x110e5a8]
/usr/sbin/mysqld(Prepared_statement::execute(String*, bool)+0x8e8) [0x1140ef8]
/usr/sbin/mysqld(Prepared_statement::execute_loop(String*, bool)+0xff) [0x114538f]
/usr/sbin/mysqld(mysqld_stmt_execute(THD*, Prepared_statement*, bool, unsigned long, PS_PARAM*)+0x191) [0x1145951]
/usr/sbin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x19a5) [0x1115105]
/usr/sbin/mysqld(do_command(THD*)+0x204) [0x1116574]
/usr/sbin/mysqld() [0x1251c40]
/usr/sbin/mysqld() [0x2620ea4]
/lib64/libpthread.so.0(+0x7ea5) [0x7fdcc1e09ea5]
/lib64/libc.so.6(clone+0x6d) [0x7fdcbff5896d]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7fd968028938): SELECT user_auth.* ,DATE(user_auth.premium_expire_date) AS premium_expire_date FROM user_auth WHERE user_auth.fub_id_people = '31763'
Connection ID (thread ID): 40788
Status: NOT_KILLED
The table in question:
CREATE TABLE `user_auth` (
`id` INT NOT NULL AUTO_INCREMENT,
`full_name` VARCHAR(50) NOT NULL DEFAULT '',
`password_change` VARCHAR(50) NOT NULL DEFAULT '' ,
`password_hash` VARCHAR(65) NOT NULL DEFAULT '',
`password_change_date` TIMESTAMP NULL DEFAULT NULL,
`type` INT NOT NULL DEFAULT '1',
`phone` VARCHAR(50) NULL DEFAULT '',
`extra` JSON NULL DEFAULT NULL,
`business` JSON NULL DEFAULT NULL,
`airtable_base` TEXT NULL,
`fub_id` INT NULL DEFAULT NULL,
`fub_id_people` INT NULL DEFAULT NULL,
`fub_assigned_user_id` INT NULL DEFAULT NULL,
`premium_expire_date` TIMESTAMP NULL DEFAULT NULL,
`verified` INT NOT NULL DEFAULT '0',
`send_sms_count` INT NULL DEFAULT '0',
`send_sms_date` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`createdOn` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedOn` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `phone` (`phone`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=576835
;