Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gd5nN-0007lZ-Hc for pgsql-bugs@arkaria.postgresql.org; Sat, 29 Dec 2018 04:00:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gd5nM-00062A-7g for pgsql-bugs@arkaria.postgresql.org; Sat, 29 Dec 2018 04:00:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gd5nL-000623-Q2 for pgsql-bugs@lists.postgresql.org; Sat, 29 Dec 2018 04:00:16 +0000 Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gd5nI-0005Sj-IT for pgsql-bugs@lists.postgresql.org; Sat, 29 Dec 2018 04:00:14 +0000 Received: by mail-io1-xd44.google.com with SMTP id a2so5670978iok.7 for ; Fri, 28 Dec 2018 20:00:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=D9vlfoV/jti9U+QTCtxLkj0uBqUQK07PM2HD8vNwsS8=; b=N8I3dCmq1VxJ3NKo9oCUeU/YDiZpXdvB0e+ab2HMeK+kKVlRMdSh68w8Zrg4ajliBc 5jO/lN6g19qWHbskb7xICUS2Dy+3MwUzxXmxFhEFuqxcHrPnGSEbFIMidIJxmdwlTaW9 eWVMdX+VBk5JwAKYzTli6zzo6tcqD6cg6e2WUk7yjiwt1l/fVpkzg85AtlAApPPmkbZ2 awkiL0UnEMD6zMX3EM3B3a/209Tqs6Z1y1UiFYbY+kNzfjllHHU5ckDWUTNtqSRSbwR5 D6xUT9+yr9gHzJKTURnl3yWa7YFjCPd7rFKadwy2xjTQ8cK/Ugh3bt2l293hL+e6WTbz gMVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=D9vlfoV/jti9U+QTCtxLkj0uBqUQK07PM2HD8vNwsS8=; b=SvUHo3eKXgjmlX0XNgwQ80EboQ4dovKtMX5hLE6dgOEXm1yGizKeIc6vidKkLUSQvj TqGbl5Jqu8Ypzedx1XQ/Ztwh+vMoq7hhLI/MKATCxePjdNPcper+cJlLfoIy5lOIC38E H85eiRQtL0xAD49oCCsixe49llMsgpfquRHcOkUhUe3ls6B11sK7lywxEQuQXKPUL8mS wxDvUBDql9uarIc5KqEziKj2ZiC+VJYuJ25giOtoICZRq4P6avVTLXGvVPyRv3lIjha4 xKzMJcqQhyiSsY1ljjTu2HJS+LdiQ8gFWBjS/JDJPMbXsLewoVLCPlN3+EFJyq3sfSNw dWkg== X-Gm-Message-State: AJcUukd9RLWsY9bpXR1lmn2+HQfIMMQJn5ueOSnAwW9WYCbZv8jJ4FP2 DMQIfQB3sa07V36otxc3KRXTTsNqETIL8LZ+4PhUYm1W X-Google-Smtp-Source: ALg8bN4tw050J6ttkZW+Xbv/keQ8d/ypiyBwukCnha9BUno/uiUXtxbdyP4Zv/k58DCXMnhZ197NgBrSmst9hChNdDM= X-Received: by 2002:a5d:84c1:: with SMTP id z1mr19528507ior.277.1546056011653; Fri, 28 Dec 2018 20:00:11 -0800 (PST) MIME-Version: 1.0 References: <15567-a9ff747c5e7c031c@postgresql.org> In-Reply-To: <15567-a9ff747c5e7c031c@postgresql.org> From: Maxim Boguk Date: Sat, 29 Dec 2018 14:59:34 +1100 Message-ID: Subject: Re: BUG #15567: Wal receiver process restart failed when a damaged wal record arrived at standby. To: lichuancheng@highgo.com, pgsql-bugs@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000060a76d057e2137d7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000060a76d057e2137d7 Content-Type: text/plain; charset="UTF-8" On Fri, Dec 28, 2018 at 8:10 PM PG Bug reporting form < noreply@postgresql.org> wrote: > The following bug has been logged on the website: > > Bug reference: 15567 > Logged by: movead > Email address: lichuancheng@highgo.com > PostgreSQL version: 10.5 > Operating system: centos7 > Description: > > [Problem description] > We use pg9.5.7 with replica and i find that if some damaged wal record > arrived at standby then the startup process on standby try to restart > walreceiver process but never sucess and log below Infinite cycle on > standby.If i try to restart database now,it sucess. > (I try it on pg10.5,the same result.) > > ----------------------------------------------------------------------------------------------------------------- > 2018-12-15 10:38:00.302 CST,,,30928,,5c1422d5.78d0,2,,2018-12-15 05:38:29 > CST,,0,FATAL,57P01,"terminating walreceiver process due to administrator > command",,,,,,,,,"" > 2018-12-15 10:38:00.302 CST,,,5546,,5c1276c1.15aa,8,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:00.302 CST,,,5546,,5c1276c1.15aa,9,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:00.302 CST,,,5546,,5c1276c1.15aa,10,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:05.308 CST,,,5546,,5c1276c1.15aa,11,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:10.314 CST,,,5546,,5c1276c1.15aa,12,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:15.319 CST,,,5546,,5c1276c1.15aa,13,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:20.325 CST,,,5546,,5c1276c1.15aa,14,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:25.331 CST,,,5546,,5c1276c1.15aa,15,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:30.336 CST,,,5546,,5c1276c1.15aa,16,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:35.342 CST,,,5546,,5c1276c1.15aa,17,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:40.348 CST,,,5546,,5c1276c1.15aa,18,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:45.353 CST,,,5546,,5c1276c1.15aa,19,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:50.359 CST,,,5546,,5c1276c1.15aa,20,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:38:55.364 CST,,,5546,,5c1276c1.15aa,21,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > 2018-12-15 10:39:00.370 CST,,,5546,,5c1276c1.15aa,22,,2018-12-13 23:12:01 > CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in record at > 5A9/11E0A90",,,,,,,,,"" > > ----------------------------------------------------------------------------------------------------------------- > > > [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. > > [Question] > I wonder that if it is a bug or you just don't want restart walreciver > process. > > It look like the same issue as I reported in BUG #15151. https://www.postgresql.org/message-id/flat/152353560977.31233.11406243320876395727%40wrigleys.postgresql.org (unfortunately I didn't have time to explore it further then). You have good description of what's going on under hood. -- Maxim Boguk Senior Postgresql DBA https://dataegret.com/ --00000000000060a76d057e2137d7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri= , Dec 28, 2018 at 8:10 PM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged = on the website:

Bug reference:=C2=A0 =C2=A0 =C2=A0 15567
Logged by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 movead
Email address:=C2=A0 =C2=A0 =C2=A0 lichuancheng@highgo.com
PostgreSQL version: 10.5
Operating system:=C2=A0 =C2=A0centos7
Description:=C2=A0 =C2=A0 =C2=A0 =C2=A0

[Problem description]
We use pg9.5.7 with replica and i find that if some damaged wal record
arrived at standby then the startup process on standby try to restart
walreceiver process but never sucess and log below Infinite cycle on
standby.If i try to restart database now,it sucess.
(I try it on pg10.5,the same result.)
---------------------------------------------------------------------------= --------------------------------------
2018-12-15 10:38:00.302 CST,,,30928,,5c1422d5.78d0,2,,2018-12-15 05:38:29 CST,,0,FATAL,57P01,"terminating walreceiver process due to administrat= or
command",,,,,,,,,""
2018-12-15 10:38:00.302 CST,,,5546,,5c1276c1.15aa,8,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:00.302 CST,,,5546,,5c1276c1.15aa,9,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:00.302 CST,,,5546,,5c1276c1.15aa,10,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:05.308 CST,,,5546,,5c1276c1.15aa,11,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:10.314 CST,,,5546,,5c1276c1.15aa,12,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:15.319 CST,,,5546,,5c1276c1.15aa,13,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:20.325 CST,,,5546,,5c1276c1.15aa,14,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:25.331 CST,,,5546,,5c1276c1.15aa,15,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:30.336 CST,,,5546,,5c1276c1.15aa,16,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:35.342 CST,,,5546,,5c1276c1.15aa,17,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:40.348 CST,,,5546,,5c1276c1.15aa,18,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:45.353 CST,,,5546,,5c1276c1.15aa,19,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:50.359 CST,,,5546,,5c1276c1.15aa,20,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:38:55.364 CST,,,5546,,5c1276c1.15aa,21,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
2018-12-15 10:39:00.370 CST,,,5546,,5c1276c1.15aa,22,,2018-12-13 23:12:01 CST,1/0,0,LOG,00000,"incorrect resource manager data checksum in recor= d at
5A9/11E0A90",,,,,,,,,""
---------------------------------------------------------------------------= --------------------------------------


[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.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 And now reciver process does not startup comple= tely,so the startup process
read the damaged wal record another times.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 And startup process set walrcv->walRcvState = =3D WALRCV_STOPPED use function
ShutdownWalRcv().
4.go to 2.
That's the infinite cycle.

[Question]
I wonder that if it is a bug or you just don't want restart walreciver<= br> process.


It look like the same is= sue as I reported in BUG #15151.
(unfortunately I didn't have time to explore it further then).

You have good description of what'= s going on under hood.


--
=
Maxim= Boguk
Senior Postgresql DBA
https://dataegret.com/


--00000000000060a76d057e2137d7--