Add recovery for 'real WAL only'.

This commit is contained in:
Ben Johnson
2020-11-06 16:30:37 -07:00
parent d964e4199a
commit 2941a2433f
7 changed files with 327 additions and 29 deletions

32
doc/NOTES.md Normal file
View File

@@ -0,0 +1,32 @@
NOTES
=====
## RECOVERY
### REAL WAL EXISTS, SHADOW EXISTS
Scenario: Unclean close by application process.
Action: Verify last page from both match.
### REAL WAL DOESN'T EXISTS, SHADOW EXISTS
Scenario: Application closed cleanly & removed WAL.
Action: Verify last page of shadow matches database page.
### REAL WAL EXISTS, SHADOW DOESN'T EXIST
Scenario: Application wrote WAL; system crashed before shadow written/sync'd.
Action: Start new generation.
### REAL WAL DOESN'T EXIST, SHADOW DOESN'T EXIST
Scenario: No writes have occurred since the DB was switched to WAL mode.
Action: Nothing to recover. Wait for first WAL write.