Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBroE-0000U8-F1 for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Apr 2018 01:04:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBroD-0008FF-Cp for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Apr 2018 01:04:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBroD-0008F5-1w for pgsql-hackers@lists.postgresql.org; Fri, 27 Apr 2018 01:04:21 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBro9-0001cu-WD for pgsql-hackers@lists.postgresql.org; Fri, 27 Apr 2018 01:04:19 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4C4DA2198B; Thu, 26 Apr 2018 21:04:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 26 Apr 2018 21:04:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=/ygkozD6NruyIKrFfPDtpdhmvbT7leLmkqQBGL3s07c=; b=cVuoAQqq Q/PndWwdxoM7BZsxrmbqrBv9OlwVPsXExeU+WsiYekJFuab/W4OjNxrhhKf4mv7W +NRKfBJbDSLX3vVTRtiAhgsKxeoxdK+wL/Kn8dI44P6IHeIvkVThe5b0uXkWkxw2 HduH7vM4UaL/zdROWXLHk+v9QaicApdplcJLGzW1qrvzhCz5LE056mw8efin3yiH hQBMCzBqmQuBYJ32pHtRv+nfFsLImt3iK45Kex4lmiFsf6AwMdD85JmbBuT2IKYV EmLOIv4xDfwZIt+WPdU0fQhDNdEbdrUKeNPYBHDFyl20XQeDem3ob6WZwTipuxdQ dIifWv+5S44b6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=/ygkozD6NruyIKrFfPDtpdhmvbT7l eLmkqQBGL3s07c=; b=VLAmmzLI1rxzBX6QXwnPxpWkjsHF/0HXY/L5Vkp+oQJuF GLvGIB32Ifj7aPSEaLw3Rm+oIBWJ/CyZRJ5VHyWf5xyHibRYchznR68vk164hRAr yOXUBLXPfK54MmMUZ0/BHryOUy/bLeZqE3OzGooaxg+8s/pLgmHf+Ghi8PQetvDV 5PizhQBJ071wr/S+sHPR0dgY7v7RsoCet5Zu1mYn/w/yYz0GusTOPyGK1HHHEG2Z 2i/twuFDA5fiwKFQZ1VU7GzSjfH2iHWu0AI7SFjQZCdiCYk9YLlmYwbkITAbDXzU 2EZeyADDsbzieC2rUQpxNBFyT/OAeiDavj+yDdn+Q== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 778FDE4921; Thu, 26 Apr 2018 21:04:14 -0400 (EDT) Date: Fri, 27 Apr 2018 10:04:11 +0900 From: Michael Paquier To: Kyotaro HORIGUCHI Cc: emre@hasegeli.com, tomas.vondra@2ndquadrant.com, pgsql-bugs@postgresql.org, gurkan.gur@innogames.com, david.pusch@innogames.com, patrick.schmidt@innogames.com, pgsql-hackers@lists.postgresql.org Subject: Re: Standby corruption after master is restarted Message-ID: <20180427010411.GF3419@paquier.xyz> References: <20180426.195304.118373455.horiguchi.kyotaro@lab.ntt.co.jp> <20180426121348.GA2365@paquier.xyz> <20180427.094908.00748548.horiguchi.kyotaro@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pyE8wggRBhVBcj8z" Content-Disposition: inline In-Reply-To: <20180427.094908.00748548.horiguchi.kyotaro@lab.ntt.co.jp> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --pyE8wggRBhVBcj8z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 27, 2018 at 09:49:08AM +0900, Kyotaro HORIGUCHI wrote: > Thank you for noticing me of that. Is there any way to know how a > bug report has been concluded? Or should I search -hackers for > a corresponding thread? Keeping a look at the list of patches for bugs in the CF app, and looking at the list of open items is what I use now. Now for this particular issue my memory has just served me well as it is hard to know that both are the same issue by looking at the title. Good thing I looked at your patch as well. > At Thu, 26 Apr 2018 21:13:48 +0900, Michael Paquier = wrote in <20180426121348.GA2365@paquier.xyz> >> On Thu, Apr 26, 2018 at 07:53:04PM +0900, Kyotaro HORIGUCHI wrote: >>> I think this behavior is a bug. XLogReadRecord is considering the >>> case but palloc_extended() breaks it. So in the attached, add a >>> new flag MCXT_ALLOC_NO_PARAMERR to palloc_extended() and >>> allocate_recordbuf calls it with the new flag. That alone fixes >>> the problem. However, the patch frees read state buffer facing >>> errorneous records since such records can leave a too-large >>> buffer allocated. >>=20 >> This problem is already discussed here: >> https://commitfest.postgresql.org/18/1516/ >>=20 >> And here is the thread: >> https://www.postgresql.org/message-id/flat/0A3221C70F24FB458334332555692= 04D1F8B57AD@G01JPEXMBYT05 >>=20 >> Tsunakawa-san and I discussed a couple of approaches. Extending >> palloc_extended so as an incorrect length does not result in an error is >> also something that crossed by mind, but the length handling is >> different on the backend and the frontend, so I discarded the idea you >> are proposing here and instead relied on a check with AllocSizeIsValid, >> which gives a more simple patch: >> https://www.postgresql.org/message-id/20180314052753.GA16179%40paquier.x= yz >=20 > Yeah, perhaps all approaches in the thread came to my mind but > choosed different one. I'm fine with the approach in the thread. Okay, cool. >> This got no interest from committers yet unfortunately, but I think that >> this is a real problem which should be back-patched :( >=20 > Several other WAL-related fixes are also waiting to be picked up.. Yeah, simply ignoring corrupted 2PC files at redo is no fun, as well as is breaking the promise of replication slots. Let's just make sure that everything is properly tracked and listed, that's the least we can do. -- Michael --pyE8wggRBhVBcj8z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlridwsACgkQnvQgOdby QH3DDw/+I5G7om7dfKdWbcv0qwSSzpu70Nia71GjbRScFJ5Nu8iwBidBr8wltAjL zBAHhiN0J0G+xekcWegS0+ng17bKCx7ICiDH+cJCjCgHsEPfMXzVITK/+MHlHnks dYqgqrOeNl5wCPGHYJ03/2PZfs6F7VGa41oNyBi6rHD7vs1kjoagaHQ0ejSFRHSk /GGyoEkBB3r6Dla3GU9B8ZxmroIQaQ+8rJdAvN7mtdGFbiwwaE2abMMEaZr10nJd t0gq139+GwKka/NwHI9otEAHctzNlfhLLHNQpd2MF+y4bI2eUyQ9Cy9260fjXn7g gmQO5kjirHLYl64ic0GNBA3/cScz7qGUIsk3mF994ikVLLOrtJnvS1pbnBs5IVWD gNA43hR3C4YvTZxirSvCu/6H6pRQw1V4MBLbYE6XAF+Cqy5iO4hKrkuyTSdyk6wR sP+aOVp+1H1ZIYaKgfM8iZiiUHHIngc1Sx7cUS1WJGGHBnUSzKGCG0TYibkw2q1f Tj1g79sREvC/N8TK1HS3OTu+HmY5z+0DCb5uPpL3g0mCzjkTAvtXj4YX9QfHgFHa YejIOdifVpnZB5W5n+EX4L+Ee6u5mfn1107oLlhuJmLoXgdjzy/R8WUWYNKHR295 9CF/DtJWnDRz8I2etmc1dZiVW0mEYSkRPNNdMn84/sKmvQkBuT8= =kpxi -----END PGP SIGNATURE----- --pyE8wggRBhVBcj8z--