Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slave 节点的 binlog offset 比 master 节点大,导致 trySync 失败 #1681

Closed
luky116 opened this issue Jul 4, 2023 · 1 comment · Fixed by #1682
Closed

slave 节点的 binlog offset 比 master 节点大,导致 trySync 失败 #1681

luky116 opened this issue Jul 4, 2023 · 1 comment · Fixed by #1682

Comments

@luky116
Copy link
Collaborator

luky116 commented Jul 4, 2023

复现步骤:
1、启动 master 节点
2、启动 slave 节点
3、slave 节点执行 slaveof master_host,发现 master 处于 up 的状态
image
4、主节点添加一条记录
5、slave 节点执行 slaveof no one
6、slave 节点执行 slaveof master_host
7、slave 节点执行 info replication,发现 master 处于 down 的状态
image
8、查看日志发现,报错了
image

@luky116
Copy link
Collaborator Author

luky116 commented Jul 4, 2023

导致的原因:
由于 slave 节点开启了 slotmigrate 配置,master 会将 _internal:slotkey:4migrate: 的数据发给 slave 节点,slave 节点会将这个数据重新计算一次 hash,再次又插入一条数据。

这样就会导致 slave 节点的数据比主节点多,进而导致 slave 节点的 offset 比主节点大,导致主节点认为从节点状态不对,拒绝 trysync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant