aboutsummaryrefslogtreecommitdiff
path: root/src/backend/storage/buffer/bufmgr.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-01-06 08:32:32 -0500
committerRobert Haas <rhaas@postgresql.org>2012-01-06 08:35:41 -0500
commitf9f04845045086feb1144f52cc2911e9f08efe3f (patch)
tree0dffe6587bdb9103c9352904714c0a48a11fb0dc /src/backend/storage/buffer/bufmgr.c
parentd1d836f92c0798f4bc4138dc6b87279199c4f49a (diff)
downloadpostgresql-f9f04845045086feb1144f52cc2911e9f08efe3f.tar.gz
postgresql-f9f04845045086feb1144f52cc2911e9f08efe3f.zip
Fix variable confusion in BufferSync().
As noted by Heikki Linnakangas, the previous coding confused the "flags" variable with the "mask" variable. The affect of this appears to be that unlogged buffers would get written out at every checkpoint rather than only at shutdown time. Although that's arguably an acceptable failure mode, I'm back-patching this change, since it seems like a poor idea to rely on this happening to work.
Diffstat (limited to 'src/backend/storage/buffer/bufmgr.c')
-rw-r--r--src/backend/storage/buffer/bufmgr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index d07c997d47c..0e5d4c568ba 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -1184,7 +1184,7 @@ BufferSync(int flags)
* buffers. But at shutdown time, we write all dirty buffers.
*/
if (!(flags & CHECKPOINT_IS_SHUTDOWN))
- flags |= BM_PERMANENT;
+ mask |= BM_PERMANENT;
/*
* Loop over all buffers, and mark the ones that need to be written with