Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqJW0-0002vp-PG for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Nov 2021 18:30:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mqJVy-0007R8-BY for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Nov 2021 18:30:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqJVx-0007Qz-Cm for pgsql-hackers@lists.postgresql.org; Thu, 25 Nov 2021 18:30:34 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mqJVt-0005fx-4d for pgsql-hackers@lists.postgresql.org; Thu, 25 Nov 2021 18:30:33 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id 6AC915806B6; Thu, 25 Nov 2021 13:30:25 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 25 Nov 2021 13:30:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=1vQv3X1qyrt7w/IQX3bV49ANi7wOmjd8vRwZpCI5+84=; b=Gh3WSeYi E1I7QLB4QOJ1faiVO9l6v7eq5SEbiycaYaDgLFg6wdDRjuEiTeiysjM3LP0o4gFE nmevhrzhYo1S1j/IXmME4Jrlg28nmuyOHql3QAQzRoTH+L+pAiZQZwNaOwf/FUWt C7K46dWie9FVC4ihR4A/e939CY0ke3280q3EBBqBqu1EVNzJiLg1CiP9s34Gc85j Y2CIfGzWRdwBoarLjA8FhbPy6ruqsagIPfS9z3hIHqbQrc5JTFUQRHtcAuEkAlNz oJOk3KgZbvRq80YYX1J8iDytDmqP5q4IZXTXFfCIU2vK2lKY4ifujIx+Q9ofAynT 6AiDMc9QcBuKww== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrhedtgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedujeevjeffjeevuddutedvkeeiueeitddvieelfeekveej udefgeeuvdejhfeuleenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Nov 2021 13:30:23 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id CB6DE2A07F5; Thu, 25 Nov 2021 15:30:20 -0300 (-03) Date: Thu, 25 Nov 2021 15:30:20 -0300 From: Alvaro Herrera To: Amul Sul Cc: Tom Lane , Andres Freund , Andrew Dunstan , "Bossart, Nathan" , Kyotaro Horiguchi , "masao.fujii@oss.nttdata.com" , "pgsql-hackers@lists.postgresql.org" , "mengjuan.cmj@alibaba-inc.com" , "Jakub.Wartak@tomtom.com" , Ryo Matsumura Subject: Re: prevent immature WAL streaming Message-ID: <202111251830.w6jpp6h5t2eu@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-Nov-25, Amul Sul wrote: > In XLogReadRecord(), both the variables being compared have > inconsistency in the assignment -- one gets assigned from > state->currRecPtr where other is from RecPtr. > > ..... > state->overwrittenRecPtr = state->currRecPtr; > ..... > state->abortedRecPtr = RecPtr; > ..... > > Before the place where assembled flag sets, there is a bunch of code > that adjusts RecPtr. I think instead of RecPtr, the latter assignment > should use state->currRecPtr as well. You're exactly right. I managed to reproduce the problem shown by buildfarm members, and indeed this fixes it. And it makes sense: the adjustment you refer to, is precisely to skip the page header when the LSN is the start of the page, which is exactly the problem we're seeing in the buildfarm ... except that on lapwing branch REL_11_STABLE, we're seeing the LSN is off by 0x14 instead of 0x18. That seems very strange. I think the reason for this is that lapwing has MAXALIGN 4, so MAXALIGN(sizeof(XLogPageHeaderData)) is 20, not 24 as is the case in the other failing members. ... checks buildfarm ... Yeah, all the others in Tom's list are x86-64. I'm pushing the fix in a minute. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "¿Qué importan los años? Lo que realmente importa es comprobar que a fin de cuentas la mejor edad de la vida es estar vivo" (Mafalda)