On Thu, 2009-06-25 at 17:11 -0400, Tom Lane wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> writes:
> > So, yes, there are some places where InRecovery is used in code executed
> > by the bgwriter, but the correct fix is to use RecoveryIsInProgress().
> Agreed, but this gets us no closer to solving the real problem, which is
> that when we perform the end-of-recovery checkpoint, we need to act like
> we are *not* in recovery anymore, for at least some purposes.
Not for some purposes, just for *one* purpose: the end of recovery
checkpoint needs to run XLogInsert() which has specific protection
against being run during recovery.
> notably, to allow us to write a WAL entry at all; but I am suspicious
> that pretty much every InRecovery/RecoveryIsInProgress test that that
> checkpoint might execute should behave as if we're not in recovery.
You are right to question whether we should revoke the patch. ISTM that
we are likely to decrease code robustness by doing that at this stage.
I think we have the problems pretty much solved now.
If we want to increase robustness, I would suggest we add a
recovery.conf parameter to explicitly enable use of bgwriter during
recovery, off by default. In addition to the fixes being worked on
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support
In response to
pgsql-bugs by date
|Next:||From: Simon Riggs||Date: 2009-06-25 21:46:31|
|Subject: Re: BUG #4879: bgwriter fails to fsync the file in recoverymode|
|Previous:||From: Heikki Linnakangas||Date: 2009-06-25 21:37:38|
|Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery