Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: local recovery explained

...

If we observe only CP begin and there is no CP end marker that means CP not finished; we have not consistent page store.

No checkpoint process 

For crash without CP at the moment when there was no checkpoint process running restore is simpletrivial, only logical record are applied.

Physical records (page snapshots and delta records) are ignored because page store is consistent.

Middle of checkpoint

Let’s suppose crash occurred at the middle of checkpoint. In that case restore process will discover markers for 1 CP1 and 2 start and CP 1 end.

For

Restore is split to 2 stages:

1st stage: Starting from previous completed checkpoint

...

record CP1 till record of CP2 start (incompleted) we apply all physical records and ignore logical.

  • In example CP2 was started but not finished. At the time of crash CP2 process was writting pages changed before CP2 was started: in this example: page(s) corresponding to PS1 & Delta 1 physical record.
  • Write of page content to page store may not incompleted (e.g. broken at the middle of page). To restore potentially corrupted page store we apply page change records. As result of updating same pages at the same place in page store, we got consistent page store. 
  • Page Snapshot records required to avoid double apply of data from delta records.

2nd stage: Starting from marker of incomplete CP2 we apply only logical records until end of WAL is reached.


When replay is finished CP2 end marker will be added.

If transaction begin record has no corresponding end, tx change is not applied. 

Summary, limitations and performance 

...