Re: BUG #4879: bgwriter fails to fsync the file in recovery mode

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: BUG #4879: bgwriter fails to fsync the file in recovery mode
Дата
Msg-id 1245965961.4038.249.camel@ebony.2ndQuadrant
обсуждение исходный текст
Ответ на Re: BUG #4879: bgwriter fails to fsync the file in recovery mode  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Thu, 2009-06-25 at 17:11 -0400, Tom Lane wrote:
> Simon Riggs <simon@2ndQuadrant.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.

> Most
> 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
currently.

--
 Simon Riggs           www.2ndQuadrant.com
 PostgreSQL Training, Services and Support

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #4883: tar xf fails on NFS4 mounts
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #4879: bgwriter fails to fsync the file in recovery mode