Fast⚡Crash Recovery in PostgreSQL [WIP]:�Design, Implementation and Challenges
Srinath Reddy Sadipiralla
Bengaluru PUG�15/11/2025
1
©EDB 2025 — ALL RIGHTS RESERVED.
Agenda
Srinath Reddy Sadipiralla�Staff SDE at EDB
Postgres Hacker
2
©EDB 2025 — ALL RIGHTS RESERVED.
What is WAL? (1/2)
3
©EDB 2025 — ALL RIGHTS RESERVED.
What is WAL? (2/2)
4
©EDB 2025 — ALL RIGHTS RESERVED.
Internals of WAL (1/3)
5
©EDB 2025 — ALL RIGHTS RESERVED.
Internals of WAL (2/3)
6
©EDB 2025 — ALL RIGHTS RESERVED.
Internals of WAL (3/3)
7
©EDB 2025 — ALL RIGHTS RESERVED.
Crash Recovery in Postgres (1/3)
8
©EDB 2025 — ALL RIGHTS RESERVED.
Crash Recovery in Postgres (2/3)
9
©EDB 2025 — ALL RIGHTS RESERVED.
Crash Recovery in Postgres (3/3)
10
©EDB 2025 — ALL RIGHTS RESERVED.
The Problem (1/3)
11
©EDB 2025 — ALL RIGHTS RESERVED.
The Problem (2/3)
* there could be other factors like WAL read speed depends on hardware.
12
©EDB 2025 — ALL RIGHTS RESERVED.
The Problem (3/3)
13
©EDB 2025 — ALL RIGHTS RESERVED.
Is it even a problem? (1/2)
14
©EDB 2025 — ALL RIGHTS RESERVED.
Is it even a problem? (2/2)
15
©EDB 2025 — ALL RIGHTS RESERVED.
Solution (1/2)
16
©EDB 2025 — ALL RIGHTS RESERVED.
Solution (2/2)
17
©EDB 2025 — ALL RIGHTS RESERVED.
Design
18
Skipping the WAL?
19
©EDB 2025 — ALL RIGHTS RESERVED.
When will the data be recovered then?
20
©EDB 2025 — ALL RIGHTS RESERVED.
Isn’t it slow to read, filter the WALs per page request?
21
©EDB 2025 — ALL RIGHTS RESERVED.
checkpointer and bgwriter processes (1/3)
22
©EDB 2025 — ALL RIGHTS RESERVED.
checkpointer and bgwriter processes (2/3)
23
©EDB 2025 — ALL RIGHTS RESERVED.
checkpointer and bgwriter processes (3/3)
24
©EDB 2025 — ALL RIGHTS RESERVED.
What if no one reads a page for a long time? (1/2)
25
©EDB 2025 — ALL RIGHTS RESERVED.
What if no one reads a page for a long time? (2/2)
26
©EDB 2025 — ALL RIGHTS RESERVED.
What if 2 processes try to read same page at a time?
27
©EDB 2025 — ALL RIGHTS RESERVED.
Challenges
28
©EDB 2025 — ALL RIGHTS RESERVED.
Current Design “Experiments” for above challenges
29
©EDB 2025 — ALL RIGHTS RESERVED.
Current state
Future of this patch: will post the patch/es with performance numbers ASAP in pg hackers mailing list.
30
©EDB 2025 — ALL RIGHTS RESERVED.
Summary (1/4)
31
©EDB 2025 — ALL RIGHTS RESERVED.
Summary (2/4)
32
©EDB 2025 — ALL RIGHTS RESERVED.
Summary (3/4)
33
©EDB 2025 — ALL RIGHTS RESERVED.
Summary (4/4)
34
©EDB 2025 — ALL RIGHTS RESERVED.
After all pages got recovered
35
©EDB 2025 — ALL RIGHTS RESERVED.
Q&A
36
Thank you
Connect with me on LinkedIn: linkedin.com/in/srinath-reddy-sadipiralla/
Reach out to me: srinath.reddy@enterprisedb.com
37
©EDB 2025 — ALL RIGHTS RESERVED.