当前位置:网站首页>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 ).
边栏推荐
- 【板栗糖GIS】arcscene—如何做出有高度的高程图
- LeetCode 968. 监控二叉树
- How should programmers write logs
- Methods of adding styles to native JS
- 杰理之内置短按再长按,不管长按多长时间都是短按【篇】
- antd组件upload上传xlsx文件,并读取文件内容
- 位的高阶运算
- LeetCode 968. Monitor binary tree
- Addition, deletion, modification and query of handwritten ORM (object relationship mapping)
- NC50965 Largest Rectangle in a Histogram
猜你喜欢

数据分析学习记录(二)---响应曲面法及Design-Expert的简单使用
![[LeetCode] 数组中的第K个最大元素【215】](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[LeetCode] 数组中的第K个最大元素【215】

Qt QScrollArea

【板栗糖GIS】arcmap—为什么使用自定义捕捉的时候,经典捕捉的勾要去掉呢?

中国信通院、清华大学、腾讯安全,云原生安全产学研用强强联合!

Qt QSplitter拆分器

Higher order operation of bits

Hanging mirror security won four global infosec awards on rsac2022

LeetCode 968. Monitor binary tree

P1007 独木桥
随机推荐
【喜欢的诗词】好了歌
Hanging mirror security won four global infosec awards on rsac2022
U++ learning note pile
[leetcode] reverse string [344]
U++ learning notes - relaxation
P7072 [CSP-J2020] 直播获奖
对象与对象变量
JS syntax ES6, ES7, es8, es9, ES10, es11, ES12 new features (Abstract)
P1007 独木桥
杰理之、产线装配环节【篇】
加油站[问题分析->问题转换->贪心]
[ODX studio edit PDX] -0.1- how to quickly view the differences in supported diagnostic information between variant variants (service, sub function...)
杰理之充电拔出,无法触摸开机【篇】
图形视图框架
Jerry's charge unplugged, unable to touch the boot [chapter]
[leetcode] reverse the word III in the string [557]
antd组件upload上传xlsx文件,并读取文件内容
Il n'est pas nécessaire d'appuyer longtemps sur la fonction de démarrage pour modifier Jelly [chapitre]
LeetCode 968. 监控二叉树
Film and television excerpts