关于MySQL的一个半同步bug和两个知识点

一、一个半同步BUG

这个BUG比较老了,主要是5.7.17以下的版本可能会遇到。这个BUG主要是主库ACK receiver线程需要将半同步从库的连接的fd注册到其中,然后监控连接的fd是否有数据到达,其实就是ACK 信息,如果有ACK信息到达,则需要读取信息同时解析ACK包,然后决定唤醒哪个或者哪些事务。但是这里使用的是select 函数,其原型如下,

   int select(int nfds, fd_set *restrict readfds,
                  fd_set *restrict writefds, fd_set *restrict exceptfds,
                  struct timeval *restrict timeout);

其中第一个参数nfds有如下限制(来自 linux man page)

POSIX allows an implementation to define an upper limit,
       advertised via the constant **FD_SETSIZE**, on the range of file
       descriptors that can be specified in a file descriptor set.  The
       Linux kernel imposes no fixed limit, but the glibc implementation
       makes *fd_set* a fixed-size type, with **FD_SETSIZE** defined as 1024,
       and the **FD_***() macros operating according to that limit.  To
       monitor file descriptors greater than 1023, 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值