Title: Crash Recovery
1????????
2?????? ?- ACIDThe ACID Properties
- Atomicity ???? ?????? ?????? ?????? ?????
?????? ??????? ?? ???? ?? - Consistency ?? ?? ???? ??? ????? (?????) ???????
???? ????, ?? ?? ???? ???? ???? - Isolation ????? ?? ???? ????? ??????? ?? ??????
????? - Durability ?? ???? ??????? ?? ?????? ??? ?????
3?????? ?- ACID (????)The ACID Properties
- ?????? ?????? ??? ?????? ???????? ?"? ???????
????? ??????? (???? Strict 2PL) - ??????? ??????? ??? ?????? ???????? ?"? ???????
?????????
- Atomicity ???? ?????? ?????? ?????? ?????
?????? ??????? ?? ???? ?? - Consistency ?? ?? ???? ??? ????? (?????) ???????
???? ????, ?? ?? ???? ???? ???? - Isolation ????? ?? ???? ????? ??????? ?? ??????
????? - Durability ?? ???? ??????? ?? ?????? ??? ?????
4?????? ??? ??????? ????
- ?????? ?????? ?????? (?? ????? abort)
- ?????? ????? ???? (???? ???? ??????)
- ?????? ???? ?? ????? ??? ??? ?????
- ????? ????? (???? ????? ????)
- ????? ???? ?????
- ???? ????? ?? ?????
- ????? ????
- ????? ????
5????? ????
- ???? ???? ??????, ??? ????? ????? ?????, ????
???? ?? ???????? ?????? ????? ???? ???????
("Rollback") - ?? ??????? ?- 2PL ????? (Strict 2PL), ?? ??? ????
???? ??????? ?? ?????? ????? (???, ??? ??? ?????)
6???????? ??????
- ?? ?? ????? ?????? ?????, ?? ??????? ???? ?????,
???? ???? ?? ???????? ???? T1, T2 ?- T3, ????? ??
???????? ???? T4 ?- T5
7????? ????Disk Crash
- ?? ????? ???? ????? ??? ?? ????, ???? ????? ????
??? ???? ???? ???? - ??? ?????? ?????? ?? ???? ???? ????? ??? ??????
?????? ??????? ?? ?? ?????? ???? - ?? ???? ????? ?? ??? ?????? ?? ????
- ??? ???? ????? ??????? ???? ????? ?????? ?????,
?? ????? ??? ??? ??? ????? ?? - ?? ????? ?? ????? ?????? ????? ????? ?????
8??????? ?? ????
- ???? ????? ????? ?? ???????? ??????
- ??? ??? ??? ????? ????????
- ????? ????? (????? ?????) ?????? ???????
- ????? ????? ????? ????? ?? ?? ???????? ??????
???? ???? ????? ????? ???? ??????? - ?? ????? ??? ??? ???? ????? ?????? ???????, ???
???? ?? ???????? ??????? - ?????? ????? ?? ?? ???????? ????? ??????
9????? ?????? ?- LOGWrite-Ahead Log (WAL)
- ???? (LOG) ??? ???? ????? ????? ??? ???? ????? ??
- ?? ???????? ???? ????? ????
- ???? ????? ????, ???? ?????? ?????? ???????
- ??????? ?????? ???? ?? ????? ?? ???? ??? ?????
???? ?? ????? - ???? ????? ????? ?? ?? ???????? ????? ???? ??
????? ???? ???? ???????
10????? ???? ?????? ??????
- ?? ?????, ???? ????? "commit" ????
- ????? ?? ??????, ?????, ????? ?? ???? ??? ?????
???? ?????? ?????? ?????? - ?? ???? ???? "commit" ?? ???? ????? ?? ????????
?????? ????? ??? ????? ???? - ?? ???? ?? ???? "commit" ?? ???? ???? ?? ????????
?????? ????? ??? ????? ????
11?????? ?????? ???? ???"? ???? ??????
- ???? ???? ?? ???? ?????
- ?????? ???? ??? ?????? ???? ??????? ??????
????? ???? ???? - ?? ????? ??? ????? ???? ???? ???? ????? ?????
???? ??? ?? (???? ??? ?? ??????), ????? - ???? ?????, ???? ?? ????, ????? ?? ???? ??? ??
?????? - ???? ????? ??-????? ?????? ???? ?????
12???? ??????Buffer Pool
- ?????? (????) ?????? ???????? ??????? ???????
?????? - ???? ????? ???????? ??????? ???????
- ??????, ?? ?????, ????? ????? ????? ??????? ??
??????? ?????? ??????? - ??? ????? ???? ?????? ?????? ??? ???????, ?? ????
???? ???? ????? ???
13??-???? No-Force
- ?? ????? ?? ???? ?????? commit ????? ????? ??
??????? ?? ???? ???? ????? - ???? ????? ?? ???????? ????? (?????, ?? ????????
?????? ???? ?? ????? ???? ?????????) - ???? ????? ????? ???? ?? ?? ?????? ?? ????, ???
????? ??? ???? ????? ???? ?????, ????? ????? ????
?? ?????? ?????? ????? ????? ????
14?? ????? ?? ??????? ??????
- ??????? ???? ????? ??-????? ???? ????? ?? ??????
- ?? ???? ????? ????? ?????? ???? ???? ?? ???? ????
???? ??????? ??????, ?? - ?? ?? ??????? ?????? ???? ?? ???? ????? ???? ????
?"? ?? ????, ???? ????? ???? ??, ??? ????? ??
????? ???? ????? (??? ???? ???? ?? ????????
?????? ????? ??)
15????? Steal
- ?? ?? ??????? ???????? ?????? ??????, ??
- ???? "?????" ???? ?? ???? ????? ???? ???????
??????, ??? ????? ???? ????? ???? ?????, ??? ????
?? ???????? ?????? ?? - ???? ???? ????????? ????? ?"? ?????? ????????
??????, ???? ???????? ????? ????? ?"? ??????
????? ?????? ?????? ??????? ????? ????? ?? ?????? - ????? ????, ???? ???? ???? ?? ???????? ??????
????? ?? ?"? ?????? ??? ??????
16?????? ????? ????? ?????
- ???? ????? ????? ???? ??????? ?????? ?"? ??????
???????? - ???? ????? ???? ???? ??????? ?????? ?"? ??????
??? ??????? - ???? ????? ??-???? ?????? ???? ???? ?? ??? ??????
?? ??????
17???? ????? ???? ??????????
- ??? ????? ???? ?? ??? ?? ???? ??????, ????? LSN
(Log Sequence Number) - ??????? ?????? ???? ???? ????, ??? ?- LSN
- ??? ?? ?? ???? ????
- ???? ????? ????? ??????? ??????
- ??? ??????
- ?- LSN ????? ???? ???? ???? (?????? ???? ????
???? ????? ???????? ?????) - ?? ???? ?????? ??? ??? ?????
18???? ?????? ????
- ????? ???? ????? ????? ????? (update)
- ????? ?????? ?? ????? ??????? ?? ?????
- ????? ???? ????? commit
- ????? ???? ????? abort
- ????? ??????? ?????? ??????? (end)
- ????? ?????? ?????? ?????
19????? ??? ???? ?????
- ??? ???? A ????????, ?? ???? ????? ??
- ???? ?????? (LSN)
- ???? ?????? ?? ?????? ?????? ???? ???? ????
- ???? ?????? ?? ?????
- ??? ?????? (???? ?????? ???? ??? ?????)
- ??? ?? ????? A ???? ?????? (before-image)
- ??? ?? A ???? ?????? (after-image)
20????? (abort) ?? ???? ?????(?????? ?????? ????)
- ????? ???? ???? ???? ???????
- ????? ????? ?????? ??????? ?? ?? ??????? ??????
- ?????? ????? abort ???? ???? ?????
- ?????? Undo ?????
21????? Undo ?? ???? ?????
- ?????? ?? ?????? ???? ?? ????? ????? ??????
- ??? ????? ????? ???? ?????, ?????? ???? ?? ????
?? ????? ???? ?????? - ????? ????? ?? ?? ?????? ???? ?? ?????, ??
??????? ????? ?"? ????? ???? ????? ?????? - ??????? ?? ?? ???????? ?????? ??????
22???????? ??????
- ???? ?????? ?????, ???? ????? ?? ???? (???????)
????? ????? ????? - ??? ??????? (Analysis Phase)
- ??? ?????? ???? (Redo Phase)
- ??? ????? ?????? (Undo Phase)
23??? ???????Analysis Phase
- ???? ?? ?????? ?? ???? (???????) ??????? ????
???? ?????? ?? ???? ?????? commit ????? ????
??? - ???? ????? ??? ???????? ?????? ?"? ??????
???????? ????? ????? ?? ????? ?? ???? - ???? ???? ?? ?? ???????? ?????? ?? ????? ?? ????
?"? ?????? ??? ???????
24??? ?????? ????Redo Phase
- ???? ?? ?????? ???? ?? ?? ??????? (???? ??? ???
???????) - ?????? ?? ???? ???????, ??? ???? ?? ???????
- ??? ????? ?????, ?????? ???? ?? ???? ?? ?????
???? ??????
25??? ????? ??????(Undo Phase)
- ???? ?? ?????? ?? ?? ??????? ?? ?????? ???
??????? - ?????? ?? ???? ????? ??????
- ???? ?? ????? ????? ?? ???? ??? ???????, ??????
???? ?? ???? ?? ????? ???? ?????? - ????? ????? ??????, ???????? ???? ?????? ????? ??
??????? ?????? ?"? ?????? ????????
26?????? ??????
- ??? ?? ???? ??? ?????? ????? ???????? ???? ?????
????? ????? ?? ??????? ?? ???? ???? ?????? - ?????? ?????? ?? ????? ?????? ????? ?? ??? ?????
???? ??? ??? ????? ???? - ?????? ????? ???? ????? ?? ????? ?? ???? (????
?????) ?? ?? ????? ?? ????? ?? ???? ??? ????
?????? ???
27????? ??? ??? ????? ????????
- ?? ?? ????? ??? ??? ????? ????????, ?? ??????? ??
????? ????????? ???? - ?????? ??????? ?? ????? ????????? ????? ?? ???
????? ????? ?? ???? (????? ????? ??? ????? ?????
?? ????), ?????? ?????? ??? ?????
28????? ??????Checkpoint
- ?? ?? ???? ???? ???????? ?????? ????
- ????? ???? ???? ?????? checkpoint
- ??????? ???? ?????? ????? ???????? ?? ?? ???????
?????? ???? - ?????? ?? ?? ???????? ??????? ?? ????
- ?????? ????? checkpoint ????
- ??????? ??? ???? ?????? ??????
- ???? ???? ???????? ??- checkpoint ??????
29?????
- ???? ???? ???? ????? ?? ??????? ?? ????, ???
????? ???? ????? ?? ???? ????? ?? ??? ??????? - ?????? ???? ????? ?????
- ?? ??????? ?????, ???? ?????? ???? ?? ????? ?????
?????? ????? ???????? (????? ????) ?????? ??????
??????? (??? ??????) ??????? ????
30??? ????? ???? ???????? ????? ?????????
- ?????? ?????? ????? ??????
- Fuzzy checkpoint
- Fuzzy backup
- ????? ???? ??????? ??????? ?? ???? ?????? ?? redo
?- undo
31?????? ?????? ????? ??????
- ??????? (??? ???????? ???? ?????? ????) ??????
????? ??????, ???? ?????? - ???, ???? ?????? ??? ???? ???? (????, ???? ????)
- ????? ????? (?? ?????) ?? ?????? ?????? ????
??????? ???????? ??????? ?? ???? - ?? ???? ????? ???? ???? ?? ???? ????? ????? ??
????? ???? (??? ??????)
32?????? ??????
- ?????, ???"? ?????? ???? ??????? ?????? ?? ??????
?????? - ?????? (?? ?????) ?? ????? ?????
- ?????? (???? ?????? ?????) ?? ?- byte ??????
????? - ???? ???? (???? ?- bytes) ?????
- ???? ?? ???? ???? ?????? (before-image)
- ???? ?? ???? ???? ?????? (after-image)
33??? ?? ???...
- ?? ????? ???? ???? ????? ??????? ??????? ??????
- ????, ??????? ??????? ?? B-tree
- ????? ?????? ?? ????? ????? ????? ?????? ??????
?? ?????? ????
34Fuzzy Checkpoint andFuzzy Backup
- ???? ????? checkpoint ???? ?????? ?? ?????? ??
?????? - ?????, ??? ????? ????
- ????? ????, ???? ?????
35????? ???? ???????
- ????? ???? ???? ??????? ???? ?????? ?? ????
??????? ??????? ?? ???? ???? ????????
36???????? ????????? ????The Aries Recovery
Algorithm
- ???????? ????????? ???? ?????
- Fuzzy checkpoint and backup
- ????? ??????? ?? ?????? ?????? ?? ??????
- ?????? ?? ???? ??????? ??????? ?? ???? ?"? ?????
???? ???? - ?? (?????) ????? ???????
- ????????? ????? ???? 20 ????