当前位置:网站首页>MySQL log module of InnoDB engine
MySQL log module of InnoDB engine
2022-07-05 12:16:00 【The king of early rising】
Updating the database SQL Statement execution , use redo log and binlog Two log modules .
The process is as follows :
analyzer -> Permission to check -> actuator -> engine redo log(prepare state ) -> binlog -> redo log(commit state )
Catalog
Why do update operations need two log modules ?
Log access order of update operation
redo log
Redo log .InnoDB Rollback function supported by the engine , It is based on this log .
Changes to the database , That is, add, delete, and modify , It will be recorded in redo log in .
When there is an accident , When the data in the database is wrong , According to redo log Do rollback .
binlog
Archive log . yes MySQL My own journal .
Cannot support transaction rollback , But it can realize data backup .
Why do update operations need two log modules ?
In theory , As far as the update operation itself is concerned , A log module can solve the problem .
But here we see , Two log modules , Different attribution . One is MySQL Self contained , The other is InnoDB Engine implementation .
Log access order of update operation
Notice that the access order of logs in the update operation is like this :
redo log(prepare state ) -> binlog -> redo log(commit state )
This is to maintain the data consistency of the two logs .
If you write first redo log To write binlog , There is an accident in the middle , The machine stops working . After restart , The machine will according to redo log Restore data , And in the binlog There is no record in the , When it comes to backup , You lose this piece of data .
If you write first binlog , Post write redo log , There is an accident in the middle , Data cannot be recovered , But there are records .
Follow the crossover operation , If it's done redo log(prepare state ) -> binlog There was an accident , You can rely on MySQL Processing mechanism of .
Judge redo log Is it complete , If complete, submit .
redo log No, commit , Go and see binlog Is it complete .
complete , Then submit redo log Of commit state .
Incomplete , Roll back .
Okay , That's all for the canto .
Keep early hours , take care . The king of early rising wishes you good luck !
边栏推荐
- GPS數據格式轉換[通俗易懂]
- [untitled]
- ACID事务理论
- Swift - add navigation bar
- 多表操作-子查询
- Principle of redis cluster mode
- Redis cluster (master-slave) brain crack and solution
- 无线WIFI学习型8路发射遥控模块
- Two minutes will take you to quickly master the project structure, resources, dependencies and localization of flutter
- [pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
猜你喜欢
Hiengine: comparable to the local cloud native memory database engine
What is digital existence? Digital transformation starts with digital existence
互联网公司实习岗位选择与简易版职业发展规划
Uniapp + unicloud + Unipay realize wechat applet payment function
[calculation of loss in yolov3]
Mmclassification training custom data
Multi table operation - Auto Association query
A guide to threaded and asynchronous UI development in the "quick start fluent Development Series tutorials"
abap查表程序
Sentinel sentinel mechanism of master automatic election in redis master-slave
随机推荐
Splunk configuration 163 mailbox alarm
leetcode:1200. Minimum absolute difference
Get all stock data of big a
Application of a class of identities (vandermond convolution and hypergeometric functions)
手机 CPU 架构类型了解
PXE startup configuration and principle
7月华清学习-1
Complete activity switching according to sliding
信息服务器怎么恢复,服务器数据恢复怎么弄[通俗易懂]
Swift - add navigation bar
MySQL index - extended data
1. Laravel creation project of PHP
HiEngine:可媲美本地的云原生内存数据库引擎
byte2String、string2Byte
Which domestic cloud management platform manufacturer is good in 2022? Why?
What is the difference between canvas and SVG?
[upsampling method opencv interpolation]
什么是数字化存在?数字化转型要先从数字化存在开始
Reinforcement learning - learning notes 3 | strategic learning
Linux安装部署LAMP(Apache+MySQL+PHP)