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

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix two bugs in setting the vm bit of empty pages.
Date: 2013-10-23 11:33:04
Message-ID: E1VYwgS-0005bv-UK@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4da24f12e63313b7dbb6b3e3d0317e04045df636

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

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2013-10-23 17:23:57 pgsql: Simplify tab completion rules for views and foreign tables.
Previous Message Tom Lane 2013-10-23 01:32:06 pgsql: Suppress a couple of compiler warnings seen with older gcc versi