Re: BUG #4879: bgwriter fails to fsync the file in recovery mode - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #4879: bgwriter fails to fsync the file in recovery mode
Date
Msg-id 7671.1245969113@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #4879: bgwriter fails to fsync the file in recovery mode  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Responses Re: BUG #4879: bgwriter fails to fsync the file in recovery mode  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Tom Lane wrote:
>> The behavior you seem to have in mind would be completely disastrous
>> from a performance standpoint, as we'd be writing and fsyncing
>> pg_control constantly during a recovery.

> Please define "constantly". We discussed that part of the patch here:
> http://archives.postgresql.org/message-id/498AB55D.50408@enterprisedb.com

Okay, after reading the code a bit more I found this:

        /*
         * To avoid having to update the control file too often, we update it
         * all the way to the last record being replayed, even though 'lsn'
         * would suffice for correctness.
         */

which should alleviate the too-many-writes syndrome.  Never mind that
complaint then.  (But shouldn't there be an Assert that this is >= lsn?)

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4883: tar xf fails on NFS4 mounts
Next
From: Tom Lane
Date:
Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode