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 1iSYg7-00052X-QS for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2019 03:41:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSYg5-0003Z2-Fq for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Nov 2019 03:41:45 +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 1iSYg5-0003Yu-0v for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2019 03:41:45 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iSYg2-0006Pe-FS for pgsql-bugs@lists.postgresql.org; Thu, 07 Nov 2019 03:41:43 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6425F21AF1; Wed, 6 Nov 2019 22:41:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 06 Nov 2019 22:41:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=9p39gFLmydfDm5ebkmmSMr7CyEs 5t+T2KbGtUfAGCUE=; b=GyDxDxTuYaor6Z5rWfJ1+fLHMYsFs0klABQkUuCy2NS FmQHYLEAuSKKw7fLpQXHf3TEILUFT6TPcOEaP7Mc/tGEFoApyUFM94PjWJvngqLi HiPxRpGhwjNQq2/qc+EhcrvCJcqU1IOKUVnngT6iygDFSYkxXQB/pCShkoarRwKH VmK39ufR1PXVkRbceR3rcnIZdtSf2ELBtKg7uCVrRiIf8Y7T/9jpUnxQn+o95pqk UofDr+b8zDbzMBpW02yQykXl5+KjnaGdOYyA/Z+oRd+KOF4lAcTKkEsgVr3i6FNI 60Hd3/9xW/VvtnXLG4yzRADd6c6iwYE0D11nbqXdaIg== 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-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=9p39gF LmydfDm5ebkmmSMr7CyEs5t+T2KbGtUfAGCUE=; b=W2gEkL1vOmhfa6Y9F7FroR Psv3dTaEYezmfhQyWm6AAGa6a7sNYs0UiKTWOkAh+Gwxas9wY0aUcoGOC64SP4i6 f+OA32XJs3gswfs19lYJiNI3N+SMOussgfRcJsFOXeKxX5kc0IiomYNvVjFQZ6Yy jiC8tOF6jMGl/hIo+2PvuhrsdRlnsxGFJGBoW+2lxXMA/SLb3XiU5L6hGWILnB8C lyT0aiFgnTuLJ9QkWA4f+S/4iC3Db4SCnrIcA9LCPdAwJi3sLFhCwyyXzyyqWTgO QZgHgSkPeXxJMIFcnWe2Pqg6g6agvTvHuTMyVpZ9SgIaxYJg2rnKhsMY96BWrq+w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedruddukedgiedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepudduuddruddtvddrudektddrudekheenucfrrghr rghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiienucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 761788005C; Wed, 6 Nov 2019 22:41:39 -0500 (EST) Date: Thu, 7 Nov 2019 12:41:36 +0900 From: Michael Paquier To: Fujii Masao Cc: Andrey Lepikhov , PostgreSQL mailing lists Subject: Re: The XLogFindNextRecord() routine find incorrect record start point after a long continuation record Message-ID: <20191107034136.GI1768@paquier.xyz> References: <99303554-5dd5-06e6-f943-b3005ccd6edd@postgrespro.ru> <20191106044120.GF1604@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NgG1H2o5aFKkgPy/" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --NgG1H2o5aFKkgPy/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 07, 2019 at 02:41:29AM +0900, Fujii Masao wrote: > I created the problematic WAL file artificially by using > pg_logical_emit_message() and sucessfully reproduced > the error. Good idea. I didn't know this one. > I attached the WAL file that I created. You can > reproduce the issue by >=20 > pg_waldump 000000010000000000000008 -s 0/08002028 Assertion failure reproduced here. > The patch looks good to me. Barrying any objection, I will commit it. > XLogFindNextRecord() must return the valid record starting position, > but currently could return the starting position of WAL page > (not valid WAL record) in the case that you described. This is > the cause of the issue. No issues from here, thanks for taking care of it. -- Michael --NgG1H2o5aFKkgPy/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3DknAACgkQnvQgOdby QH09+g//TVadMK4crp06HcsZEl+NIewu9P7kLLicB/mbcY3V+GZNnUBIH1ZYLxnv UgITJ+EwIGgdFE7jxE7P4bIZFXM7XKH1V9nKw/iYYVTCrfs2V+Ean8yCoJGe9yMf rH0csmBxTKiypjkNRd8xFTR1M8uBwIpAivB0PaQvXzD/SFOmtzgJ0Xlp3UDPvLNS XGlCvxTKhFBLlXSyYxqTp1tZu9dg2D25kW3q53UiDhZ2m1/RY1kVr9FURsNKWR0p kiFgfav9DaJmankTxe433O9ZxX/AJMS1odC+PoYpqJ/lWPYlnQQC24j//o4Uz17D e3KJQYPIP0w9pRN3nYTZy+eISuDDNpTMQwe09Jy7ULBrd7rkc1HstBOYBL1WAaLQ kTMSJM5l8rvoQlBk+mYHL1eVYLv+xGL4xy2VHGDIvkfIXFWgPH64fzmBMJjezkUu SW3Cu2mXNrmY3/+ST/50qHfKqA80huircwcNh878odapj3OkdxxDvVISG2DhoH1Y YhrJEvL2NoBKctPrv3QcGyx4pRxR3fAT5Z7HDns+0/Lma9IuO2Eqqk5GB6uxWyjL 4h5YdG/Osp5839QWCZpLYEhkza9UDYPhTNMPk0e+ZLH4735EPRyzNcApbV5/L4c2 3n85raEXRVse07hBzk0KjCzfc5tU4msI/lmRvypV5hperwojHqg= =glL7 -----END PGP SIGNATURE----- --NgG1H2o5aFKkgPy/--