pgsql: Simplify the way changes to full_page_writes are logged.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Simplify the way changes to full_page_writes are logged.
Date: 2012-03-06 08:18:58
Message-ID: E1S4pbm-0003WP-Mj@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Simplify the way changes to full_page_writes are logged.

It's harmless to do full page writes even when not strictly necessary, so
when turning full_page_writes on, we can set the global flag first, and then
call XLogInsert. Likewise, when turning it off, we can write the WAL record
first, and then clear the flag. This way XLogInsert doesn't need any special
handling of the XLOG_FPW_CHANGE record type. XLogInsert is complicated
enough already, so anything we can keep away from there is a good thing.

Actually I don't think the atomicity of the shared memory flag matters,
anyway, because we only write the XLOG_FPW_CHANGE at the end of recovery,
when there are no concurrent WAL insertions going on. But might as well make
it safe, in case we allow changing full_page_writes on the fly in the
future.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3b682df3260aa8e020201e4b6c5cbc31fe8ecb8e

Modified Files
--------------
src/backend/access/transam/xlog.c | 60 +++++++++++++++---------------------
1 files changed, 25 insertions(+), 35 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-03-06 08:47:34 pgsql: Make the comments more clear on the fact that UpdateFullPageWrit
Previous Message Bruce Momjian 2012-03-06 02:20:08 pgsql: In pg_upgrade, only lock the old cluster if link mode is used, a