최근에 5.5에서 5.7.19로 업그레이드 한 후 프로덕션 MySQL 서버가 가끔 충돌했습니다. 다음은 오류 로그에있는 스택 추적과 문제가있는 쿼리와 관련된 테이블입니다. 일반적인 로그를 표시하고 MySQL이 충돌 할 때마다 표시됩니다. 마지막 몇 개의 로그 항목에 매우 큰 insert on duplicate key
쿼리가있었습니다.중복 키 쿼리에서 mysql 크래시가 발생했습니다.
0xf4bd75 my_print_stacktrace + 53
0x7d0144 handle_fatal_signal + 1188
0x34d8a0f710 _end + -693094128
0x800b23 Field_blob::copy_blob_value(st_mem_root*) + 51
0xe9af6e mysql_prepare_blob_values(THD*, List<Item>&, st_mem_root*) + 686
0xe9b575 write_record(THD*, TABLE*, COPY_INFO*, COPY_INFO*) + 565
0xe9c952 Sql_cmd_insert::mysql_insert(THD*, TABLE_LIST*) + 2146
0xe9d16e Sql_cmd_insert::execute(THD*) + 222
0xd10279 mysql_execute_command(THD*, bool) + 4025
0xd1481d mysql_parse(THD*, Parser_state*) + 1005
0xd160ac dispatch_command(THD*, COM_DATA const*, enum_server_command) + 6188
0xd16a74 do_command(THD*) + 404
0xdea70c handle_connection + 668
0xf69d64 pfs_spawn_thread + 372
0x34d8a079d1 _end + -693126191
0x311e4e8b6d _end + 475909485
CREATE TABLE `t` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`col2` varchar(128) DEFAULT NULL,
`col3` int(11) DEFAULT NULL ,
`col4` int(11) DEFAULT NULL ,
`col5` int(11) DEFAULT NULL ,
`col6` int(11) DEFAULT NULL ,
`col7` varchar(128) DEFAULT NULL ,
`col8` varchar(1024) DEFAULT NULL ,
`report` longtext ,
`create_date` datetime DEFAULT NULL ,
`start_date` datetime DEFAULT NULL ,
`finish_date` datetime DEFAULT NULL ,
`state` varchar(128) DEFAULT NULL ,
`col9` text ,
`col10` int(11) DEFAULT NULL ,
`col11` int(11) DEFAULT NULL ,
`col12` text ,
`count_post` int(11) DEFAULT NULL ,
`count_reply` int(11) DEFAULT NULL ,
`count_link` int(11) DEFAULT NULL ,
`remark` text ,
PRIMARY KEY (`id`),
UNIQUE KEY `col2` (`col2`),
KEY `col4` (`col4`),
KEY `col5` (`col5`),
KEY `col6` (`col6`),
KEY `col7` (`col7`),
KEY `create_date` (`create_date`),
KEY `finish_date` (`finish_date`)
) ENGINE=InnoDB AUTO_INCREMENT=405597973 DEFAULT CHARSET=utf8'
5.7.19의 버그입니까? 관련 문제가 발견되었습니다. Crash on UPDATE ON DUPLICATE KEY하지만 반복 할 수는 없습니다. 이 문제를 어떻게 피할 수 있습니까? 아니면 어떻게 해결할 수 있습니까?
로 윌슨 Hauck는 지적, threads_%
mysql> SHOW GLOBAL STATUS LIKE 'threads_%';
+-------------------+-------+
| Variable_name | Value |
+-------------------+-------+
| Threads_cached | 1 |
| Threads_connected | 2530 |
| Threads_created | 5920 |
| Threads_running | 2 |
+-------------------+-------+
mysql> SHOW GLOBAL VARIABLES LIKE 'thread_%';
+-------------------+---------------------------+
| Variable_name | Value |
+-------------------+---------------------------+
| thread_cache_size | 8 |
| thread_handling | one-thread-per-connection |
| thread_stack | 262144 |
+-------------------+---------------------------+
THREAD 생성/생성이 문제와 관련되어 나타납니다. 의 결과를 공유해주세요. SHOW GLOBAL STATUS LIKE 'threads_ %'; 과 SHOW GLOBAL VARIABLES LIKE 'thread_ %' –
@WilsonHauck 질문 끝에 "thread"와 관련된 것들을 추가했습니다. – zczhuohuo
시스템이 안정적입니까? 그렇다면 최상의 대답을 받아 들여 '답이 없음'목록에서 빠져 나오십시오. –