在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

怎么理解MySQL中半同步引起Master实例Crash

103次阅读
没有评论

共计 4365 个字符,预计需要花费 11 分钟才能阅读完成。

怎么理解 MySQL 中半同步引起 Master 实例 Crash,很多新手对此不是很清楚,为了帮助大家解决这个难题,下面丸趣 TV 小编将为大家详细讲解,有这方面需求的人可以来学习下,希望你能有所收获。

场景 : 
Crash 发生时的数据库版本: MySQL-5.7.12, 官方标注在 5.7.17 进行了 fix;
开启半同步的主从架构中, 从库开启半同步, 启动 / 重启 slave 线程导致 Master 实例 Crash;

结论 :
mysql bug, 附上 bug 单链接: https://bugs.mysql.com/bug.php?id=79865

问题描述(摘抄):

Description: From 5.7,semi-sync add Ack_receiver thread for listening slave ack,which use select(). But select() can only listen socket fd between 1 and __FD_SET_SIZE(my os is 1024), when socket fd is bigger than __FD_SET_SIZE, select() has no effect, and can never get ack from slave,then semi-sync can t run normally.even more,select() use array store fds, when use FD_SET store fd which is bigger than __FD_SET_SIZE, array will overflow,so mysqld may crash。

主要问题就出在 tcp 连接的 select 方法, 通常, 操作系统通过宏 FD_SET_SIZE 来声明一个进程中 select 能操作的文件描述符的最大数据, 然而通常情况下, 这个 FD_SET_SIZE 的值仅为 1024;

实际上, 用 epoll 或者 poll 会比较少, select 貌似是用的很少的;

问题复现:

准备一套 MySQL-5.7.12 的主从架构, 开启半同步:

为了能尽量简单的启用大量的文件描述符, 这里利用 MyISAM 分区表的 特性

这时候在主库上连续执行 select 语句多次(

这时候看一下主库的文件描述符数量;

那么现在在开启半同步的从库上重启一下 slave, 同时 tail 一下主库的日志;

在重启线程几秒钟之后, 主库就发生了 Crash;

PS: 在测试的过程中, 多次执行了 select 语句, 然后确认主库的半同步状态也是 ON 的情况下迅速在从库上重启 slave, 基本是必现的;
PPS: MyISAM 表在 open 的时候会同时打开所有的分区文件, 所以能比较方便的模拟占用大量文件描述符的情景;
(MyISAM 分区表: http://blog.itpub.net/29510932/viewspace-2134679/)
PPPPPPPS:  _(:з」∠)_

附上测试用的脚本与 Crash 的信息

CREATE TABLE `myisam_t` (

 `id` int(11) DEFAULT NULL

) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4

/*!50100 PARTITION BY HASH (id)

PARTITIONS 2000 */

点击 (此处) 折叠或打开

2017-04-28T22:10:00.731611+08:00 5092 [Note] Start binlog_dump to master_thread_id(5092) slave_server(13043), pos(, 4)

2017-04-28T22:10:01.648365+08:00 5092 [Note] Start semi-sync binlog_dump to slave (server_id: 13043), pos(, 4)

*** buffer overflow detected ***: /usr/sbin/mysqld terminated

 Backtrace: 

/lib/x86_64-linux-gnu/libc.so.6(+0x731af)[0x7fcdfc7981af]

/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fcdfc81dcf7]

/lib/x86_64-linux-gnu/libc.so.6(+0xf6f10)[0x7fcdfc81bf10]

/lib/x86_64-linux-gnu/libc.so.6(+0xf8c67)[0x7fcdfc81dc67]

/usr/lib/mysql/plugin/semisync_master.so(_ZN12Ack_receiver17get_slave_socketsEP6fd_set+0x83)[0x7fcc73d4a493]

/usr/lib/mysql/plugin/semisync_master.so(_ZN12Ack_receiver3runEv+0x603)[0x7fcc73d4aaf3]

/usr/lib/mysql/plugin/semisync_master.so(ack_receive_handler+0x19)[0x7fcc73d4aba9]

/usr/sbin/mysqld(pfs_spawn_thread+0x1b4)[0xe90784]

/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7fcdfdf650a4]

/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fcdfc80d87d]

点击 (此处) 折叠或打开

14:10:01 UTC – 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.

Attempting to collect some information that could help diagnose the problem.

As this is a crash and something is definitely wrong, the information

collection process might fail.

key_buffer_size=8388608

read_buffer_size=131072

max_used_connections=5

max_threads=9999

thread_count=8

connection_count=2

It is possible that mysqld could use up to

key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 21899362 K  bytes of memory

Hope that s ok; if not, decrease some variables in the equation.

Thread pointer: 0x0

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 = 0 thread_stack 0x40000

/usr/sbin/mysqld(my_print_stacktrace+0x2c)[0xe77fec]

/usr/sbin/mysqld(handle_fatal_signal+0x459)[0x7a7019]

/lib/x86_64-linux-gnu/libpthread.so.0(+0xf8d0)[0x7fcdfdf6c8d0]

/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7fcdfc75a067]

/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7fcdfc75b448]

/lib/x86_64-linux-gnu/libc.so.6(+0x731b4)[0x7fcdfc7981b4]

/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fcdfc81dcf7]

/lib/x86_64-linux-gnu/libc.so.6(+0xf6f10)[0x7fcdfc81bf10]

/lib/x86_64-linux-gnu/libc.so.6(+0xf8c67)[0x7fcdfc81dc67]

/usr/lib/mysql/plugin/semisync_master.so(_ZN12Ack_receiver17get_slave_socketsEP6fd_set+0x83)[0x7fcc73d4a493]

/usr/lib/mysql/plugin/semisync_master.so(_ZN12Ack_receiver3runEv+0x603)[0x7fcc73d4aaf3]

/usr/lib/mysql/plugin/semisync_master.so(ack_receive_handler+0x19)[0x7fcc73d4aba9]

/usr/sbin/mysqld(pfs_spawn_thread+0x1b4)[0xe90784]

/lib/x86_64-linux-gnu/libpthread.so.0(+0x80a4)[0x7fcdfdf650a4]

/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fcdfc80d87d]

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains

information that should help you find out what is causing the crash.

看完上述内容是否对您有帮助呢?如果还想对相关知识有进一步的了解或阅读更多相关文章,请关注丸趣 TV 行业资讯频道,感谢您对丸趣 TV 的支持。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-19发表,共计4365字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 小蜜被两老头吸奶头在线观看 | 性xxxx老妇506070 | 98精品国产高清在线xxxx | 欧美性另类69xxxx| 亚洲日本中文字幕在线 | a视频网站 | 日韩国产在线播放 | 韩国精品一区二区三区 | 免费少妇a级毛片 | 久久精品在线播放 | 久草资源站在线 | 国产激情一级毛片久久久 | 久久精品最新免费国产成人 | 免费网站你懂的 | 四虎成人欧美精品在永久在线 | 中文字幕欧美日韩一 | 欧美老妇牲交videos | 特黄aaaaaaaaa真人毛片 | 久久激情日本亚洲欧洲国产中文 | 精品无码国产一区二区三区51安 | 男人网站在线亚洲影院 | 国产欧美一区二区三区视频 | 朝鲜女人大白屁股ass | 91麻豆国产福利在线观看 | 国产精品成人3p一区二区三区 | 国产极品粉嫩福利姬萌白酱 | 黄色美女网站免费看 | 香蕉久久夜色精品国产2020 | 成人久久久观看免费毛片 | 国产欧美日韩中文字幕 | 久久久日韩精品一区二区 | 国产精品亚洲综合网站 | 精品网址 | 四虎影院最新网站 | 少妇特殊按摩高潮惨叫无码 | 国产成人夜间影院在线观看 | 四虎四虎| 91网站免费看| 狠狠做深爱婷婷久久综合一区 | 国产乱沈阳女人高潮乱叫老 | 免费在线观看毛片 |