当前位置:网站首页>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 )
边栏推荐
- Sitge joined the opengauss open source community to jointly promote the ecological development of the database industry
- Oracle检查点队列–实例崩溃恢复原理剖析
- The real situation of programmers
- Incentive mechanism of Ethereum eth
- Net small and medium-sized enterprise project development framework series (one)
- 深信服X计划-网络协议基础 DNS
- 初级软件测试必问面试题
- AD637使用筆記
- [Yugong series] go teaching course in July 2022 004 go code Notes
- 854. String BFS with similarity K
猜你喜欢
![[Yugong series] go teaching course 003-ide installation and basic use in July 2022](/img/9d/7d01bc1daa61f6545f619b6746f8bb.png)
[Yugong series] go teaching course 003-ide installation and basic use in July 2022

【愚公系列】2022年7月 Go教学课程 003-IDE的安装和基本使用

ICMP introduction

装饰器学习01

K210学习笔记(四) K210同时运行多个模型

Sorting out the problems encountered in MySQL built by pycharm connecting virtual machines

Feng Tang's "spring breeze is not as good as you" digital collection, logged into xirang on July 8!

A number of ventilator giants' products have been recalled recently, and the ventilator market is still in incremental competition

Making global exception handling classes with aspect

Efficiency difference between row first and column first traversal of mat data types in opencv
随机推荐
K210学习笔记(四) K210同时运行多个模型
Interview questions for basic software testing
The real situation of programmers
Alibaba cloud award winning experience: build a highly available system with polardb-x
Pointer parameter passing vs reference parameter passing vs value parameter passing
华为游戏多媒体调用切换房间方法出现异常Internal system error. Reason:90000017
Some common processing problems of structural equation model Amos software
极狐公司官方澄清声明
Shell script, awk uses if, for process control
Oracle checkpoint queue - Analysis of the principle of instance crash recovery
Analysis and test of ModbusRTU communication protocol
AD637使用筆記
Huawei cloud modelarts text classification - takeout comments
Summary of data analysis steps
NET中小型企业项目开发框架系列(一个)
854. 相似度为 K 的字符串 BFS
How to add new fields to mongodb with code (all)
2.2 basic grammar of R language
AD637使用笔记
sql常用语法记录