Tom Lane wrote:
> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>> Simon Riggs wrote:
>>> On Thu, 2009-06-25 at 12:43 -0400, Tom Lane wrote:
>>>> What about "revert the patch"?
>>> That's probably just as dangerous.
>> I don't feel comfortable either reverting such a big patch at last
> Yeah, I'm not very happy with that either. However, I've still got no
> confidence in anything proposed so far.
>> I'm testing the attached patch at the moment. It's the same as the
>> previous one, with the elog() in mdsync() issue fixed.
> This seems like a kluge on top of a hack. Can't we have the bgwriter
> do the final checkpoint instead?
Here's a patch taking that approach, and I think it's better than the
previous one. I was afraid we would lose robustness if we have to set
the shared state as "out of recovery" before requesting the checkpoint,
but we can use the same trick we were using in startup process and set
LocalRecoveryInProgress=false before setting the shared variable. I
introduced a new CHECKPOINT_IS_STARTUP flag, which is otherwise
identical to CHECKPOINT_IS_SHUTDOWN, but in a startup checkpoint
CreateCheckPoint() excpects to be called while recovery is still active,
and sets LocalRecoveryInProgress=false. It also tells bgwriter that it
needs to do a checkpoint instead of a restartpoint, even though recovery
is still in progress.
In response to
pgsql-bugs by date
|Next:||From: Tom Lane||Date: 2009-06-25 18:46:08|
|Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode |
|Previous:||From: Heikki Linnakangas||Date: 2009-06-25 18:25:54|
|Subject: Re: BUG #4879: bgwriter fails to fsync the file in recovery