Fix two bugs in setting the vm bit of empty pages.

Heikki Linnakangas <heikki.linnakangas@iki.fi>

Commit: 83eb54001cb69d6ee8f0813c4e280be876823068
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: 2013-10-23T11:24:37Z
Releases: 9.4.0
Fix two bugs in setting the vm bit of empty pages.

Use a critical section when setting the all-visible flag on an empty page,
and WAL-logging it. log_newpage_buffer() contains an assertion that it
must be called inside a critical section, and it's the right thing to do
when modifying a buffer anyway.

Also, the page should be marked dirty before calling log_newpage_buffer(),
per the comment in log_newpage_buffer() and src/backend/access/transam/README.

Patch by Andres Freund, in response to my report. Backpatch to 9.2, like
the patch that introduced these bugs (a6370fd9).

Files

PathChange+/−
src/backend/commands/vacuumlazy.c modified +6 −1