pgsql: Fix two bugs in setting the vm bit of empty pages. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix two bugs in setting the vm bit of empty pages.
Date
Msg-id E1VYwgS-0005bu-Tr@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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).

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f90d7426ed3605ab925910a387783163763833fa

Modified Files
--------------
src/backend/commands/vacuumlazy.c |    7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix two bugs in setting the vm bit of empty pages.
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix two bugs in setting the vm bit of empty pages.