当前位置:网站首页>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 !
边栏推荐
- 只是巧合?苹果 iOS16 的神秘技术竟然与中国企业 5 年前产品一致!
- MySQL transaction
- Principle of persistence mechanism of redis
- Liunx prohibit Ping explain the different usage of traceroute
- mysql拆分字符串做条件查询
- MySQL trigger
- ABAP table lookup program
- Check the debug port information in rancher and do idea remote JVM debug
- Course design of compilation principle --- formula calculator (a simple calculator with interface developed based on QT)
- 1 plug-in to handle advertisements in web pages
猜你喜欢

Sentinel sentinel mechanism of master automatic election in redis master-slave
![[upsampling method opencv interpolation]](/img/6b/5e8f3c2844f0cbbbf03022e0efd5f0.png)
[upsampling method opencv interpolation]

How can beginners learn flutter efficiently?

MySQL splits strings for conditional queries

Linux Installation and deployment lamp (apache+mysql+php)

Master the new features of fluent 2.10

Codeworks 5 questions per day (1700 average) - day 5

Uniapp + unicloud + Unipay realize wechat applet payment function

Principle of persistence mechanism of redis

mysql拆分字符串做条件查询
随机推荐
Pytorch MLP
abap查表程序
[deploy pytoch project through onnx using tensorrt]
Tabbar configuration at the bottom of wechat applet
yolov5目標檢測神經網絡——損失函數計算原理
Hash tag usage in redis cluster
MySQL index - extended data
Thoughts and suggestions on the construction of intelligent management and control system platform for safe production in petrochemical enterprises
PXE启动配置及原理
[calculation of loss in yolov3]
[loss functions of L1, L2 and smooth L1]
mmclassification 训练自定义数据
MySQL trigger
Pytorch softmax regression
GPS数据格式转换[通俗易懂]
语义分割实验:Unet网络/MSRC2数据集
Swift - add navigation bar
GPS data format conversion [easy to understand]
Time tools
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug