当前位置:网站首页>Recovery technology with checkpoints
Recovery technology with checkpoints
2022-07-05 21:58:00 【Short section senior】
Problem presentation
Two questions
Searching the entire log will take a lot of time
Redo processing : Re execution , Wasted a lot of time
Solution
With checkpoints (checkpoint) Recovery technology
Add checkpoint records to the log file (checkpoint)
Add restart file
The recovery subsystem dynamically maintains the log during log file login
Checkpoint Technology
What the checkpoint records
Create a list of all transactions that are executing at checkpoint time
The last logged address of these transactions
Restart the contents of the document
Record the address of each checkpoint recorded in the log file
How to maintain log files dynamically
Periodically do the following : Set up checkpoints , Save database state .
The specific steps are :
(1) Write all the log records in the current log buffer to the log file on disk
(2) Write a checkpoint record in the log file
(3) Write all data records of the current data buffer to the database of the disk
(4) Write the address of the checkpoint recorded in the log file to a restart file
Set up checkpoints
The recovery subsystem can establish checkpoints periodically or irregularly , Save database state
regular
At a predetermined time interval , For example, set up a checkpoint every hour
Irregular
According to some rules , If the log file is half full, create a checkpoint
Recovery strategy utilizing checkpoints
Using checkpoint methods can improve recovery efficiency
When a transaction T Submit... Before a checkpoint ,T Changes made to the database have been written to the database
The write time is before or when the checkpoint is established
In recovery processing , There is no need to T Perform redo operation
When the system fails , The recovery subsystem will adopt different recovery strategies according to different transaction states
T1: Submit... Before checkpoint
T2: Start execution before checkpoint , Submit after checkpoint and before fault point
T3: Start execution before checkpoint , Not completed at the point of failure
T4: Start execution after checkpoint , Submit... Before the point of failure
T5: Start execution after checkpoint , Not completed at the point of failure
Recovery strategy
T3 and T5 Not completed at the time of failure , So it was revoked
T2 and T4 Submit after checkpoint , The changes they make to the database may still be in the buffer at the time of the failure , Not yet written to the database , So do it again
T1 Submitted before checkpoint , So you don't have to redo
Recovery steps using checkpoints
(1) Find the address of the last checkpoint recorded in the log file... From the restart file , This address finds the last checkpoint record in the log file
(2) The checkpoint records the list of all transactions being executed at the checkpoint establishment time ACTIVE-LIST
Create two transaction queues
UNDO-LIST
REDO-LIST
hold ACTIVE-LIST Put in for a while UNDO-LIST queue ,REDO The queue is temporarily empty .
(3) Scan log files forward from checkpoint , Until the end of the log file
If there is a new beginning Ti, hold Ti Put in for a while UNDO-LIST queue
If there are committed transactions Tj, hold Tj from UNDO-LIST The queue moves to REDO-LIST queue ; Until the end of the log file
(4) Yes UNDO-LIST Each transaction in performs UNDO operation
Yes REDO-LIST Each transaction in performs REDO operation
Welcome to join me for wechat exchange and discussion ( Please note csdn Add )
边栏推荐
- EL与JSTL注意事项汇总
- datagrid直接编辑保存“设计缺陷”
- About the writing method of SQL field "this includes" and "included in" strings
- Zhang Lijun: la pénétration de l’incertitude dépend de quatre « invariants»
- GCC9.5离线安装
- "Grain mall" -- Summary and induction
- QML reported an error expected token ";", expected a qualified name ID
- Reptile practice
- 【愚公系列】2022年7月 Go教学课程 004-Go代码注释
- Hysbz 2243 staining (tree chain splitting)
猜你喜欢
Ad637 notes d'utilisation
Official clarification statement of Jihu company
K210 learning notes (IV) k210 runs multiple models at the same time
Kingbasees v8r3 cluster maintenance case -- online addition of standby database management node
How can Huawei online match improve the success rate of player matching
matlab绘制hsv色轮图
Yolov5 training custom data set (pycharm ultra detailed version)
ICMP 介绍
Parker driver maintenance COMPAX controller maintenance cpx0200h
AD637 usage notes
随机推荐
Emotional analysis of wechat chat records on Valentine's day based on Text Mining
poj 3237 Tree(树链拆分)
How to organize an actual attack and defense drill
Kingbasees v8r3 data security case - audit record clearing case
MATLAB | App Designer·我用MATLAB制作了一款LATEX公式实时编辑器
AD637使用筆記
An exception occurred in Huawei game multimedia calling the room switching method internal system error Reason:90000017
Robot operation mechanism
Some things make feelings nowhere to put
使用Aspect制作全局异常处理类
sql常用语法记录
深信服X计划-网络协议基础 DNS
EBS Oracle 11g cloning steps (single node)
如何组织一场实战攻防演练
Codeforces 12D Ball 树形阵列模拟3排序元素
PyGame practical project: write Snake games with 300 lines of code
MySQL disconnection reports an error MySQL ldb_ exceptions. OperationalError 4031, The client was disconnected by the server
Parker driver maintenance COMPAX controller maintenance cpx0200h
Installation of VMware Workstation
one hundred and twenty-three thousand four hundred and fifty-six