BUG #15567: Wal receiver process restart failed when a damaged wal record arrived at standby. - Mailing list pgsql-bugs

From lichuancheng@highgo.com
Subject BUG #15567: Wal receiver process restart failed when a damaged wal record arrived at standby.
Date
Msg-id 2019010317504815140834@highgo.com
Whole thread Raw
Responses Re: BUG #15567: Wal receiver process restart failed when a damagedwal record arrived at standby.  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
hello

I have analysis of the causes of bug when report it.

>[Code review]
>I read the code about startup process and walreciver process.
>When a damaged wal record arrived:
>1.The startup process shutdown the walreciver process use function ShutdownWalRcv().
>2.The startup process start the walreciver process use funtion RequestXLogStreaming() by signal PMSIGNAL_START_WALRECEIVER.
>3.The startup process try to read wal record. 
> And now reciver process does not startup completely,so the startup process read the damaged wal record another times.
> And startup process set walrcv->walRcvState = WALRCV_STOPPED use function ShutdownWalRcv().
>4.go to 2.
>That's the infinite cycle.


And now i do a patch in mail attachment to solve the bug.  
I test it on pg10.5 and work well.

-----
movead
Attachment

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: BUG #15548: Unaccent does not remove combining diacriticalcharacters
Next
From: Hugh Ranalli
Date:
Subject: Re: BUG #15548: Unaccent does not remove combining diacritical characters