]> granicus.if.org Git - postgresql/commitdiff
Fix variable confusion in BufferSync().
authorRobert Haas <rhaas@postgresql.org>
Fri, 6 Jan 2012 13:32:32 +0000 (08:32 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 6 Jan 2012 13:35:41 +0000 (08:35 -0500)
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.

src/backend/storage/buffer/bufmgr.c

index d07c997d47cdb6ae8d40f4539859cba8bcb70e5e..0e5d4c568ba48d46d9fb72422a2ba3fa515f5985 100644 (file)
@@ -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