Re: Crash by targetted recovery - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: Crash by targetted recovery
Date
Msg-id 899463ee-549c-3f30-5752-ae1988ddc066@oss.nttdata.com
Whole thread Raw
In response to Crash by targetted recovery  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Crash by targetted recovery
List 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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Allow auto_explain to log plans before queries are executed
Next
From: Yugo NAGATA
Date:
Subject: Re: Allow auto_explain to log plans before queries are executed