当前位置:网站首页>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 ).
边栏推荐
- 性能优化----严苛模式
- Unity publishes a method of webgl playing sound
- 杰理之内置短按再长按,不管长按多长时间都是短按【篇】
- U++ learning note pile
- 'when to use const char * and when to use const char []' - when to use const char * and when to use const char []
- 牛客网:最大子矩阵
- 中国信通院、清华大学、腾讯安全,云原生安全产学研用强强联合!
- [NPUCTF2020]ezlogin xPATH注入
- 杰理之如何测试按键的误触率【篇】
- Addition, deletion, modification and query of handwritten ORM (object relationship mapping)
猜你喜欢

World Environment Day | Chow Tai Fook serves wholeheartedly to promote carbon reduction and environmental protection

NC50965 Largest Rectangle in a Histogram

全面解析分享购商业模式逻辑?分享购是如何赋能企业

LeetCode 968. 监控二叉树
![[foreign journal] sleep and weight loss](/img/81/42dcfae19e72a0bc761cb7a40fe5d5.jpg)
[foreign journal] sleep and weight loss

Qt QScrollArea

Mathematical modeling -- graph and network models and methods (I)

地方经销商玩转社区团购模式,百万运营分享

Objects and object variables

牛客网:龙与地下城游戏
随机推荐
Kubernetes uses the host name to allocate the pod on the specified node
UE4 game architecture learning notes
Webrtc audio and video capture and playback examples and mediastream media stream analysis
Oracle cursor
MySQL reset password, forget password, reset root password, reset MySQL password
stop slave卡住--事务的事件没有复制完整
JS solution for obtaining the width and height of hidden elements whose display is none
Qt QProgressBar详解
Go语言sqlx库操作SQLite3数据库增删改查
Baidu AI Cloud - create a face recognition application
[leetcode] reverse the word III in the string [557]
图形视图框架
Oracle PL / SQL programming
Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
杰理之内置关机电流 1.2uA,之后不能长按开机【篇】
[LeetCode] 存在重复元素【217】
Introduction to database system Chapter 1 short answer questions - how was the final exam?
杰理之直接触摸样机的顶针反应不正常【篇】
NC50965 Largest Rectangle in a Histogram
Developers share | HLS and skillfully use Axi_ Customize the master bus interface instructions and improve the data bandwidth - area exchange speed