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 6920.1246029635@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:
> One idea is to merge LocalWALWriteAllowed and LocalRecoveryInProgress
> (and the corresponding shared variables too) into one XLogState variable
> with three states
> * in-recovery
> * normal operation
> * shutdown.

> The variable would always move from a lower state to higher,

Hmm ... this doesn't really feel cleaner to me, although I'm not sure
why not.  One point is that you really don't have enough states there;
there's a difference between "in recovery" and "writing end-of-recovery
checkpoint".  Also, you stated that you want to disable XLogInsert again
as soon as the EOR checkpoint is written, so I don't believe that the
state sequence is really monotonic, unless you split in-recovery into
three sub-states.

On the whole I prefer keeping "InRecovery" and "XLogInsertAllowed" as
separate concepts, I think.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode
Next
From: Tom Lane
Date:
Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode