当前位置:网站首页>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 )
边栏推荐
- poj 3237 Tree(树链拆分)
- HYSBZ 2243 染色 (树链拆分)
- Implementing Lmax disruptor queue from scratch (IV) principle analysis of multithreaded producer multiproducersequencer
- An exception occurred in Huawei game multimedia calling the room switching method internal system error Reason:90000017
- Codeforces 12D Ball 树形阵列模拟3排序元素
- MySQL连接断开报错MySQLdb._exceptions.OperationalError 4031, The client was disconnected by the server
- 大约SQL现场“这包括”与“包括在”字符串的写法
- K210学习笔记(四) K210同时运行多个模型
- Xlrd common operations
- Alibaba cloud award winning experience: build a highly available system with polardb-x
猜你喜欢
張麗俊:穿透不確定性要靠四個“不變”
Countdown to 92 days, the strategy for the provincial preparation of the Blue Bridge Cup is coming~
AD637 usage notes
PIP install beatifulsoup4 installation failed
力扣------经营摩天轮的最大利润
Shell script, awk condition judgment and logic comparison &||
K210 learning notes (IV) k210 runs multiple models at the same time
Daily question brushing record (XIV)
Installation of VMware Workstation
怎么利用Tensorflow2进行猫狗分类识别
随机推荐
Chap2 steps into the palace of R language
kingbaseES V8R3数据安全案例之---审计记录清除案例
场景化面试:关于分布式锁的十问十答
oracle 控制文件的多路复用
Net small and medium-sized enterprise project development framework series (one)
Microservice link risk analysis
华为游戏多媒体调用切换房间方法出现异常Internal system error. Reason:90000017
NET中小型企业项目开发框架系列(一个)
How can Huawei online match improve the success rate of player matching
Some common processing problems of structural equation model Amos software
HDU 4391 paint the wall segment tree (water
Poj 3237 Tree (Tree Chain Split)
1.2 download and installation of the help software rstudio
Drawing HSV color wheel with MATLAB
华为快游戏调用登录接口失败,返回错误码 -1
Environment configuration problem record
The Blue Bridge Cup web application development simulation competition is open for the first time! Contestants fast forward!
Cross end solutions to improve development efficiency
854. String BFS with similarity K
regular expression