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 1iSD8O-000628-HY for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Nov 2019 04:41:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iSD8M-0005bP-Vj for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Nov 2019 04:41:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSD8M-0005bI-Nt for pgsql-bugs@lists.postgresql.org; Wed, 06 Nov 2019 04:41:30 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iSD8J-0008LY-Pe for pgsql-bugs@lists.postgresql.org; Wed, 06 Nov 2019 04:41:30 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 65AA33FF; Tue, 5 Nov 2019 23:41:25 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 05 Nov 2019 23:41:25 -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=NcdyU6HzYWeV26OmpZtS5JVyuwc QIi1UzEXa6EvLZRQ=; b=OSKYVy/h6KtNpjaWz4jjANkMTGbifTGAv7R23+bv0y9 ef/ktyNQD4XzfVsfmcQKXHO/W8PECicDawylM+ovHIWRGi+2ubMqe7ypUwncbm4O yrFhFJdEbwXorBEBsL9OvspKz3epfbMg1WcJ4jdBu3Aq4AFowbbet3UoK9afbfbW NQFc6OuJ4aVR4nabut/FyoC2VnQqyNX7Q74oI+53vlXq7m0HR8jY5MHZhlkJ7JA8 AwaB8BzTrvTtV5JdXJr/LxvCzmGfdws0EsuKIdWKLZvJLYVl8NL3nFFX5f2cYyIt o77e0956sORAy5z7c4wNYluBv9FfY8vq0R+VSrHzaCA== 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=NcdyU6 HzYWeV26OmpZtS5JVyuwcQIi1UzEXa6EvLZRQ=; b=mUOMnfJODinMs0kegOCzUN vqee0J9/5/lfVNI3Pc5Afk6OXPfNM/cS86YYS50QD8jmFP/E+a1P/EaX1jSy+1yz 7AKCINQSepmOaRUqlX6mvK32yx3ZwSE69gL3hRWHwV4FqhdcOYK7rh2ipOb51isB Z7dU/pIpddG/4q8OWIw3Wop9heWegvzTNtGkRWTjpO3OQRI7p/T9KuZU0l0cnqSG NsSNPIqxtseSKcfLf1vpWKvUSPG8s72/9wJfa//+4GVHlCVZRkHjErJciS7xoD6X u1PtqB/HXDffjMMGqsBdR4+rfVrGW8utMHurRXhqtAXpI+PJNKX+Uu6+SY9NexRA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudduiedgjeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecu kfhppeduuddurddutddvrddukedtrddukeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluhhsthgvrhfuihiivgeptd 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 8CE7380059; Tue, 5 Nov 2019 23:41:23 -0500 (EST) Date: Wed, 6 Nov 2019 13:41:20 +0900 From: Michael Paquier To: Andrey Lepikhov Cc: PostgreSQL mailing lists Subject: Re: The XLogFindNextRecord() routine find incorrect record start point after a long continuation record Message-ID: <20191106044120.GF1604@paquier.xyz> References: <99303554-5dd5-06e6-f943-b3005ccd6edd@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="SxgehGEc6vB0cZwN" Content-Disposition: inline In-Reply-To: <99303554-5dd5-06e6-f943-b3005ccd6edd@postgrespro.ru> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --SxgehGEc6vB0cZwN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 06, 2019 at 07:40:48AM +0500, Andrey Lepikhov wrote: > I found this in our multimaster project on PostgreSQL 11.5. It is difficu= lt > to reproduce this error, but I will try to do it if necessary. >=20 > The rest of a continuation WAL-record can exactly match the block size. In > this case, we need to switch targetPagePtr to the next block before > calculating the starting point of the next WAL-record. > See the patch in attachment for the bug fix. What's the error you actually saw after reading the record in xlogreader.c? If you have past WAL archives, perhaps you are able to reproduce the problem with a given WAL segment and pg_waldump? This code rings a bell as of this thread which led to commit bab7823: https://www.postgresql.org/message-id/CABOikdPsPByMiG6J01DKq6om2+BNkxHTPkOy= qHM2a4oYwGKsqQ@mail.gmail.com Reminds me as well of the following: https://www.postgresql.org/message-id/CAOR=3Dd=3D16x+jKM=3D00AoEZEKU9RJDwjU= 9E2bUnFBpX_HrGjkMHXg@mail.gmail.com -- Michael --SxgehGEc6vB0cZwN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3CTvAACgkQnvQgOdby QH2dXw/+OyJ0dJD2QZcOPoNbDP45cNyETqAaiUQ5Z8qthExW54oGut6SroN68Ucj JoO1J21gH97OFa0NNIspzy6PQOZCgmnChxBICoJYxip+PI7/VmYBbUJl73Q0TPu1 iaYHyOIkMGStdlBef9VjO5yc88Jb0JZ7bXtDeq/c/B7TCELGW9Vi4t2UPFUEe8P4 uyhEzjTYSBJ4f+6snRtSoJLjpealdmE4I9hS4pWzy1wecKoZBxAQy6j287FtpeyM OlpsJ1uvJr3QGpoSxMI4uUPpxnrOM1yljH6jAuiD4tqDAuQ8BIcxe7qiTdAaz9mr usM7QAujaYYw3pMk0U2cYxr1TUwRmklbdooNziW0eP+KrguFhmYewEqojCvCMwip D8rGNOFWEouJqyxHJ1Uz5p7NBB6E1iNHh9+gblkVKKDhIpS59pg44aAm7FCyDvh/ uHjFOtmsVHKDaouDKY+kADnMOTBn5BadaeeAIZrD6vC6b8UzRIwmq4dj9yG556K2 U0siocpGjaATs7mqsFcISjfXy7DR57Z/Z3LdPnYneLpVfzB64gsYOlC/A0QpcQ/w gGp4UBtFOiY0L3WVTG2IrDsTCGt5v3nH+AlxzWfHFHdQO2rwBWB1uJVAy2+w5EKD PoJBFZYIyex0WLCSN0znXW8U5Yt9RT/RYXxJy1RrbqgSC6Cq8iU= =XEub -----END PGP SIGNATURE----- --SxgehGEc6vB0cZwN--