Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7e4911b

Browse files
committed
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.
1 parent bd0e74a commit 7e4911b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/buffer/bufmgr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ BufferSync(int flags)
11911191
* buffers. But at shutdown time, we write all dirty buffers.
11921192
*/
11931193
if (!(flags & CHECKPOINT_IS_SHUTDOWN))
1194-
flags |= BM_PERMANENT;
1194+
mask |= BM_PERMANENT;
11951195

11961196
/*
11971197
* Loop over all buffers, and mark the ones that need to be written with

0 commit comments

Comments
 (0)