当前位置:网站首页>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 !
边栏推荐
- byte2String、string2Byte
- Yolov5 target detection neural network -- calculation principle of loss function
- Check the debug port information in rancher and do idea remote JVM debug
- [yolov3 loss function]
- Xi IO flow
- 多表操作-子查询
- 7月华清学习-1
- MySQL storage engine
- Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
- Image hyperspectral experiment: srcnn/fsrcnn
猜你喜欢

How can beginners learn flutter efficiently?

Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)

Pytorch softmax regression

Matlab struct function (structure array)

July Huaqing learning-1
调查显示传统数据安全工具在60%情况下无法抵御勒索软件攻击
![[untitled]](/img/56/6a9a4bcab6503872942fff7a365def.jpg)
[untitled]

Matlab imoverlay function (burn binary mask into two-dimensional image)

What is digital existence? Digital transformation starts with digital existence

Liunx prohibit Ping explain the different usage of traceroute
随机推荐
Understand kotlin from the perspective of an architect
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
PXE startup configuration and principle
Pytorch linear regression
Video networkState 属性
Splunk configuration 163 mailbox alarm
Open3d mesh (surface) coloring
Differences between IPv6 and IPv4 three departments including the office of network information technology promote IPv6 scale deployment
2022年国内云管平台厂商哪家好?为什么?
MySQL transaction
你做自动化测试为什么总是失败?
Hiengine: comparable to the local cloud native memory database engine
Time tools
A new WiFi option for smart home -- the application of simplewifi in wireless smart home
Linux Installation and deployment lamp (apache+mysql+php)
Image hyperspectral experiment: srcnn/fsrcnn
Sentinel sentinel mechanism of master automatic election in redis master-slave
【load dataset】
Application of a class of identities (vandermond convolution and hypergeometric functions)
POJ-2499 Binary Tree