postgres.git / summary / log / commit / refs
commit 9c855045809362f2cdabc110afd6ab8a4b250507
Author: Simon Riggs <simon@2ndQuadrant.com>
Date: Sun Sep 16 18:54:34 2012 +0000
First released in: 9.3.0, 9.1.6, 9.2.1
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.
src/backend/storage/buffer/bufmgr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index f1c29e9d4a8..77d4fbf0b9a 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -1206,9 +1206,9 @@ BufferSync(int flags)
/*
* Unless this is a shutdown checkpoint, we write only permanent, dirty
- * buffers. But at shutdown time, we write all dirty buffers.
+ * buffers. But at shutdown or end of recovery, we write all dirty buffers.
*/
- if (!(flags & CHECKPOINT_IS_SHUTDOWN))
+ if (!((flags & CHECKPOINT_IS_SHUTDOWN) || (flags & CHECKPOINT_END_OF_RECOVERY)))
mask |= BM_PERMANENT;
/*
[parent: fa41f294f6c9]