Re: Crash by targetted recovery

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Crash by targetted recovery
Date: 2020-02-27 05:40:55
Message-ID: 899463ee-549c-3f30-5752-ae1988ddc066@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/02/27 12:48, Kyotaro Horiguchi wrote:
> Hello.
>
> We found that targetted promotion can cause an assertion failure. The
> attached TAP test causes that.
>
>> TRAP: FailedAssertion("StandbyMode", File: "xlog.c", Line: 12078)
>
> After recovery target is reached, StartupXLOG turns off standby mode
> then refetches the last record. If the last record starts from the
> previous WAL segment, the assertion failure is triggered.

Good catch!

> The wrong point is that StartupXLOG does random access fetching while
> WaitForWALToBecomeAvailable is thinking it is still in streaming. I
> think if it is called with random access mode,
> WaitForWALToBecomeAvailable should move to XLOG_FROM_ARCHIVE even
> though it is thinking that it is still reading from stream.

I failed to understand why random access while reading from
stream is bad idea. Could you elaborate why?

Isn't it sufficient to set currentSource to 0 when disabling
StandbyMode?

Regards,

--
Fujii Masao
NTT DATA CORPORATION
Advanced Platform Technology Group
Research and Development Headquarters

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo NAGATA 2020-02-27 05:48:05 Re: Allow auto_explain to log plans before queries are executed
Previous Message Pavel Stehule 2020-02-27 05:27:24 Re: Allow auto_explain to log plans before queries are executed