当前位置:网站首页>MySQL transaction submission process
MySQL transaction submission process
2022-06-23 17:33:00 【User 7353950】
Yes binlog Of CR The way ( The key point is !!): Yes binlog Under the circumstances ,commit When the action begins , There will be one. Redo XID The action record of is written as redo, Then write data To binlog,binlog After writing successfully , Will binlog Of filename, Log write location position Write again redo(position I'll also write about pos In the document ), This indicates that the transaction is completed (committed). If only XID, There is no back filename and position, Means that the transaction is prepare state . technological process : commit; --> write XID to redo. --> write data to Binlog. --> write filename,postsion of binlog to redo. --> commited.
Record Binlog Is in InnoDB engine Prepare( namely Redo Log Write to disk ) after , This is crucial .
If the transaction crashes at different stages ,recovery Shi Huifa ——
crash The occurrence stage | State of affairs | Transaction results |
|---|---|---|
When the transaction is prepare Stage crash | The transaction was not written to Binary log, The engine layer does not write redo To disk . | This transaction rollback. |
When the transaction is binlog Writing stage crash | At this point, the engine layer redo Disk has been written , but Binlog The log has not been successfully written to disk . | This transaction rollback. |
When the transaction is binlog After the log is written to the disk crash, But the engine layer didn't have time commit | At this point, the engine layer redo Disk has been written ,server layer binlog Disk has been written , but redo Transaction state in did not end correctly . | read out binlog Medium xid, And notify the engine layer to submit these XID The business of . After the engine submits these , Other transactions will be rolled back , Make the engine layer redo and binlog Logs are always consistent on transactions . Business passes through recovery Automatically complete the submission . |
To sum up, if a transaction is in prepare Successful drop in stage , And in MySQL Server Layer. binlog Also write success , Then this matter must be commit success .
(redolog Write a successful && binlog Write a successful == commit, Be short of one cannot .)
边栏推荐
- 以 27K 成功入职字节跳动,这份《 软件测试面试笔记》让我受益终身
- 创新技术领航者!华为云GaussDB获颁2022年云原生数据库领域权威奖项
- Database Experiment 2 query
- Jmeter压力测试教程
- Li Kou daily question - day 25 -495 Timo attack
- How to choose an account opening broker? Is it safe to open an account online now?
- How to configure MySQL log management
- [network communication -- webrtc] source code analysis of webrtc -- bandwidth estimation at the receiving end
- How do you choose to buy stocks? Good security?
- Codeforces Round #620 (Div. 2)ABC
猜你喜欢
![[go] calling Alipay to scan code for payment in a sandbox environment](/img/d4/c6d72a697bc08f69f11121a15109b3.png)
[go] calling Alipay to scan code for payment in a sandbox environment

hands-on-data-analysis 第二单元 第四节数据可视化

C # connection to database

官方零基础入门 Jetpack Compose 的中文课程来啦

What can the accelerated implementation of digital economy bring to SMEs?

Self supervised learning (SSL)

Comparison of asemi Schottky diode and ultrafast recovery diode in switching power supply

Here comes the official zero foundation introduction jetpack compose Chinese course!

Intranet penetration token stealing

【网络通信 -- WebRTC】WebRTC 源码分析 -- PacingController 相关知识点补充
随机推荐
时间戳90K是什么意思?
Codeforces Round #620 (Div. 2)ABC
10分钟后性能测试瓶颈调优!想进大厂这个必须会
如何通过线上股票开户?在线开户安全么?
Elk log collection system deployment
How can the points mall make profits
Hapoxy cluster service setup
Practice sharing of chaos engineering in stability management of cloud native Middleware
How important is 5g dual card dual access?
Get first and last days by year
Online communication - the combination of machine learning and knowledge reasoning in trusted machine learning (Qing Yuan talk, issue 20, Li Bo)
官方零基础入门 Jetpack Compose 的中文课程来啦!
如何设计一个秒杀系统?
QT当中的【QSetting和.ini配置文件】以及【创建Resources.qrc】
[untitled] Application of laser welding in medical treatment
三分钟学会如何找回mysql密码
Li Kou daily question - day 25 -495 Timo attack
Postgresql_根据执行计划优化SQL
单火线设计系列文章10:拓展应用-单火开关实现双控
ABAP essay - material master data interface enhancement