Re: 9.2.3 crashes during archive recovery - Mailing list pgsql-hackers

From KONDO Mitsumasa
Subject Re: 9.2.3 crashes during archive recovery
Date
Msg-id 5135E091.6060706@lab.ntt.co.jp
Whole thread Raw
In response to Re: 9.2.3 crashes during archive recovery  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Responses Re: 9.2.3 crashes during archive recovery  (Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>)
Re: 9.2.3 crashes during archive recovery  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Hi,

Horiguch's patch does not seem to record minRecoveryPoint in ReadRecord();
Attempt patch records minRecoveryPoint.
[crash recovery -> record minRecoveryPoint in control file -> archive recovery]
I think that this is an original intention of Heikki's patch.

I also found a bug in latest 9.2_stable. It does not get latest timeline and
recovery history file in archive recovery when master and standby timeline is different.

Best regards,

(2013/03/05 18:22), Kyotaro HORIGUCHI wrote:
> Hello, I could cause the behavior and might understand the cause.
>
> The head of origin/REL9_2_STABLE shows the behavior I metioned in
> the last message when using the shell script attached. 9.3dev
> runs as expected.
>
> In XLogPageRead, when RecPtr goes beyond the last page, the
> current xlog file is released and new page requested.
>
> The variables were as below at the point.
>
>    StandbyRequested == true
>    StandbyMode == false
>    ArchiveRecoveryRequested == true
>    InArchiveRecovery == false
>
> In this case, XLogPageRead immediately returns NULL before trying
> to get xlogs via streaming nor from archive. So ReadRecord
> returns NULL, then unexpectedly exits 'main redo apply loop' and
> increases timeline ID as if it were promoted.
>
> This seems fiexed by letting it try all requested
> sources. Attached patch does it and the test script runs as
> expected.
>
>> We found that PostgreSQL with this patch unexpctedly becomes
>> primary when starting up as standby. We'll do further
>> investigation for the behavior.
>>
>>>> Anyway, I've committed this to master and 9.2 now.
>>>
>>> This seems to fix the issue. We'll examine this further.
>
> regards,
>
>
>
>
--
Mitsumasa KONDO
NTT OSS Center

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: 9.2.3 crashes during archive recovery
Next
From: Kevin Grittner
Date:
Subject: Re: Materialized views WIP patch