postgres.git / summary / log / commit / refs

commit    f9f04845045086feb1144f52cc2911e9f08efe3f
Author:   Robert Haas <rhaas@postgresql.org>
Date:     Fri Jan 06 13:32:32 2012 +0000
First released in: 9.2.0, 9.1.3

    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.


src/backend/storage/buffer/bufmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 [parent: d1d836f92c07]