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

Commit f9f0484

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 d1d836f commit f9f0484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/buffer/bufmgr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ BufferSync(int flags)
11841184
* buffers. But at shutdown time, we write all dirty buffers.
11851185
*/
11861186
if (!(flags & CHECKPOINT_IS_SHUTDOWN))
1187-
flags |= BM_PERMANENT;
1187+
mask |= BM_PERMANENT;
11881188

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

0 commit comments

Comments
 (0)