Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ru5ML-002KTV-2k for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Apr 2024 06:53:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ru5MJ-000uuW-5i for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Apr 2024 06:53:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ru5MI-000uuN-Q3 for pgsql-hackers@lists.postgresql.org; Tue, 09 Apr 2024 06:53:30 +0000 Received: from wfout6-smtp.messagingengine.com ([64.147.123.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ru5MF-001ig9-Ux for pgsql-hackers@postgresql.org; Tue, 09 Apr 2024 06:53:30 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.west.internal (Postfix) with ESMTP id D87C91C000D3; Tue, 9 Apr 2024 02:53:24 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 09 Apr 2024 02:53:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712645604; x=1712732004; bh=Lj2HcPVxDS g+jap9Ij/4yY17/cvBUusD+H8GIADzBSE=; b=BEDhwO95BfhR+KTBewFYU/+RJs LCg9uKWROKjn1I0Q0eUnAykfznWr9MYDzBaw5Qvn+7jvZj7gecZmk2aYjKSwTHb3 Pa3USveQFGdh18oE+OiZ+kiT88o4IVPio4HqTGWPcx1L+zCNvW7dyM57piYH1fJd w7sNG64mnuWsnhVra2+gHK78C4SyTdvl9JKmFHF+npybRB3jfCyo5t+JWRk/l3/b h7ja0ZLEcaqsG4wP02BBLng+byO5xeiDMtki1Hwdy6ZyKFHBNZxAS3RQAvP9Z2Uq 9VfrLjDxPuy9YBVtOaZHB3n3g/Dm2YhHXq29ny5etpyQ2K/Gj+zgcAbAAtkQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712645604; x=1712732004; bh=Lj2HcPVxDSg+jap9Ij/4yY17/cvB UusD+H8GIADzBSE=; b=m35NzgeJdQ3KBTUkdnImvK9WsmZmEl47zKJSesg8Q9sv qKfggZBlduArrkrnKV2R6MbwUK3yWKZLV/LFeH3wJlVdgt28O9GYBfxeu2fPxenC NnW1SmAl1ayhmDB1O1P27CeUDdUEBkrY9dDzAHkTuV8ES4x31yvR7secscRC2NlA 3Oei7Kqv6pEp/R6+zxdKn4KWmifW5z0WsvTo3ot3Ew5zqcBb98wMcuTzzr2NqpuR /eQDhd5rAs4w+hUVJUlX3gRGzfOI+pxezZ8b7Jfcv4E8EUHIMhnHuqy0Ufzh2vL8 /m6L1NS3Nc17UGFc3b/7PDdSNxpQYfFAaaKI2RRQmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegkedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Apr 2024 02:53:21 -0400 (EDT) Date: Tue, 9 Apr 2024 15:53:08 +0900 From: Michael Paquier To: "Hayato Kuroda (Fujitsu)" Cc: Amit Kapila , Alexander Lakhin , Robert Haas , Jeff Davis , Heikki Linnakangas , "pgsql-hackers@postgresql.org" Subject: Re: Is this a problem in GenericXLogFinish()? Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BeTF/HyUr6l4fTUf" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BeTF/HyUr6l4fTUf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Apr 05, 2024 at 06:22:58AM +0000, Hayato Kuroda (Fujitsu) wrote: > Thanks for pointing out. Yes, we fixed a behavior by the commit aa5edbe37, > but we missed the redo case. I made a fix patch based on the suggestion [1]. + bool mod_buf = false; Perhaps you could name that mod_wbuf, to be consistent with the WAL insert path. I'm slightly annoyed by the fact that there is no check on is_prim_bucket_same_wrt for buffer 1 in the BLK_NEEDS_REDO case to show the symmetry between the insert and replay paths. Shouldn't there be at least an assert for that in the branch when there are no tuples (imagine an else to cover xldata->ntups == 0)? I mean between just before updating the hash page's opaque area when is_prev_bucket_same_wrt. I've been thinking about ways to make such cases detectable in an automated fashion. The best choice would be verifyBackupPageConsistency(), just after RestoreBlockImage() on the copy of the block image stored in WAL before applying the page masking which would mask the LSN. A problem, unfortunately, is that we would need to transfer the knowledge of REGBUF_NO_CHANGE as a new BKPIMAGE_* flag so we would be able to track if the block rebuilt from the record has the *same* LSN as the copy used for the consistency check. So this edge consistency case would come at a cost, I am afraid, and the 8 bits of bimg_info are precious :/ -- Michael --BeTF/HyUr6l4fTUf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmYU5dQACgkQnvQgOdby QH2S+Q/9EFJP2WUZVbkInpG+1lamE4z6BYMunkBoI0ISWiqnu9xNAIbqTCZzEtVu Ckr7jqAoEKZbzRSSZCkT++blxOFJEhHQzrcYlcZr2lN7y7oAN9XkGFZeQaZCobM3 ZBUdLSzC7xL9Vm3YYiMQg/qN9tLyTt+k1zSTwS0MKdupduCn3L9CditV+/LsvbGf HwZ+zttxwhb2UYRzwJLaBB7nd5sZDLBQgFX0dEDZQe3+8CY7q/4yy59UPTEPZzwW SgujuxV8cNLSNBp0at7tC2FWaVO7qN14vcw3Hqxdw+ewJjSmRu6DT7Oth69NiKHU ndaVf9eDuBIH44oclNA78bOyZT7BdbbkCrBkiKqclxDMq2w2q4hCIe/EDjN8pO8j kT38tcWlGrXZkOAsU4X41GAWpa6nyDRxwvckQLEihusxir2OlGUs8nwImvZs+gKr MrhSCGuVszXnSkSODW+CAfh4Tzyndy678DEPs/y/8TDGGimHX90Ft27Z3xgFtWZU Z/sW6OyYEA3okzcWGGSsa+hR7ElUTLx2SggV/rWzUj/TVspC0cyMLF5ABbvtxNU5 PTVqQdARocPE8HNZDxiD0U5Vgil9/+EHCnlCZ+dnZI5zn/xYtxZL0/L0J+9JbFvX TLIUvaE8GWreCG8GFPF5kMpOD1Zw13fkka6o96XMLt9LdiZCrVw= =5yjp -----END PGP SIGNATURE----- --BeTF/HyUr6l4fTUf--