Skip to content

Commit 64e196b

Browse files
Fix bufmgr so CHECKPOINT_END_OF_RECOVERY behaves as a shutdown checkpoint.
Recovery code documents clearly that a shutdown checkpoint is executed at end of recovery - a shutdown checkpoint WAL record is written but the buffer manager had been altered to treat end of recovery as a normal checkpoint. This bug exacerbates the bufmgr relpersistence bug. Bug spotted by Andres Freund, patch by me.
1 parent 3275426 commit 64e196b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,9 +1206,9 @@ BufferSync(int flags)
12061206

12071207
/*
12081208
* Unless this is a shutdown checkpoint, we write only permanent, dirty
1209-
* buffers. But at shutdown time, we write all dirty buffers.
1209+
* buffers. But at shutdown or end of recovery, we write all dirty buffers.
12101210
*/
1211-
if (!(flags & CHECKPOINT_IS_SHUTDOWN))
1211+
if (!((flags & CHECKPOINT_IS_SHUTDOWN) || (flags & CHECKPOINT_END_OF_RECOVERY)))
12121212
mask |= BM_PERMANENT;
12131213

12141214
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy