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

主从延迟比较大的情况下切换怎么处理? #25

Open
jdj199222 opened this issue Sep 29, 2019 · 1 comment
Open

主从延迟比较大的情况下切换怎么处理? #25

jdj199222 opened this issue Sep 29, 2019 · 1 comment

Comments

@jdj199222
Copy link

通过查阅相关模块文档,没有看到主从延迟比较大,比如延迟几分钟这样,如果主库发生故障,那么是否切换,如何控制高延迟的是否切换,是否会自动修复数据差异后切换?

@happy-v587
Copy link

happy-v587 commented Mar 16, 2021

通过查阅相关模块文档,没有看到主从延迟比较大,比如延迟几分钟这样,如果主库发生故障,那么是否切换,如何控制高延迟的是否切换,是否会自动修复数据差异后切换?

这个问题其实需要业务自己决定,作为一个工具无法提供切or不切。

针对这个问题,可以细化几种场景

看业务级别:

  • 如果认为丢点数据没有问题,就可以切换。业务会丢一部分数据
  • 否则请看下面的逻辑

主库binlog是否完全同步给从库relay-log

  • 全部同步,只延迟几分钟,我理解可以切换,切换后依然开启只读,等relay-log全部回放完再关闭只读。影响业务只读时间长一点,数据不丢不花
  • 全部同步,延迟大于几小时,需要业务方接入,决定切or不切

@jdj199222

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

No branches or pull requests

2 participants