当前位置:网站首页>Stop slave is stuck -- the event of the transaction is not copied completely
Stop slave is stuck -- the event of the transaction is not copied completely
2022-07-02 22:55:00 【Xiangyun 123456】
In the article stop slave Get stuck , A preliminary introduction to stop slave And some reasons .
And articles stop slave Stuck simulation – Big business scenario in , Introduced the large transaction scenario ,stop slave The simulation .
This article introduces another case : The events of a transaction are not completely copied to the slave database .
In the master-slave architecture , After updating the data on the main database , Will write binlog, And copy to the slave Library .
In transactional storage engines , Such as innoDB, Data updates are in transactions .
A transaction usually has many event form , for example begin, commit,query, write_rows wait .
Commit a transaction on the master database , Event write binlog, Then copy to the slave Library , Start playback from the Library binlog. Playback from the library binlog, Not all of a transaction event After copying them , Just started playback , But one side I/O Thread receive binlog journal , On one side SQL Thread application binlog journal .
such , There may be a problem , If a transaction event More , Only a part event Copy to from library , At this time, the main library fails or The network is disconnected , The remaining... Cannot be received from the library event, Lead to SQL The thread has been waiting for the rest event.
At this time , Execute... On the slave library stop slave,SQL Thread will wait , Until the waiting time is exceeded ( Default 60s), Then roll back the transaction .
Basic troubleshooting ideas :
- Check the major tasks being implemented event( Big business monitoring in advance , You can collect what is being executed event).
- View the error log from the Library , Determine the log location of the master database that is being copied from the slave database . Use this log point , In the old main warehouse binlog Find the corresponding event in .
- The analysis reason :
- If what is being executed is begin event , And the event corresponding to the replication site from the library is not commit, Then we can get , Lead to stop slave The reason for the timeout is that the event of the transaction is not received completely .
- Ongoing SQL yes Normal update SQL, Lead to stop slave The reason for the timeout may be that the transaction is relatively large , The actual implementation is time-consuming , It may also be that the event is not received completely ( Because it is impossible to determine whether the executing transaction and the replicating transaction are the same ).
边栏推荐
- 附加:【登录信息存储】与【登录状态校验】;(包括:总结了到目前为止,有关【登录信息存储】与【登录状态校验】的所有内容;)
- 加油站[问题分析->问题转换->贪心]
- php实现根据输入的年龄查询出生日期符合的数据
- PHP implements querying the data matching the date of birth according to the entered age
- mysql重置密码,忘记密码,重置root密码,重置mysql密码
- `Usage of ${}`
- Gas station [problem analysis - > problem conversion - > greed]
- Niuke: Dragon and dungeon games
- Share 10 JS closure interview questions (diagrams), come in and see how many you can answer correctly
- Jatpack------LiveData
猜你喜欢
[foreign journal] sleep and weight loss
Qt QSplitter拆分器
[NPUCTF2020]ezlogin xPATH注入
Gas station [problem analysis - > problem conversion - > greed]
QT qsplitter splitter
[leetcode] reverse the word III in the string [557]
数学建模——图与网络模型及方法(一)
分享 10 个 JS 闭包面试题(图解),进来看看你能答对多少
【喜欢的诗词】好了歌
mysql重置密码,忘记密码,重置root密码,重置mysql密码
随机推荐
杰理之充电拔出,无法触摸开机【篇】
Introduction and response to high concurrency
送给即将工作的自己
數據分析學習記錄--用EXCEL完成簡單的單因素方差分析
杰理之快速触摸不响应问题【篇】
Golang面试整理 三 简历如何书写
Share 10 JS closure interview questions (diagrams), come in and see how many you can answer correctly
Qt QScrollArea
U++ learning note pile
手写ORM(对象关系映射)增删改查
E-commerce system microservice architecture
boot actuator - prometheus使用
P7072 [CSP-J2020] 直播获奖
Performance optimization - rigorous mode
[leetcode] reverse the word III in the string [557]
Jerry's charge unplugged, unable to touch the boot [chapter]
To myself who is about to work
php实现根据输入的年龄查询出生日期符合的数据
Film and television excerpts
LeetCode 968. Monitor binary tree