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 1qsuX8-00A3Fe-6t for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Oct 2023 00:35:34 +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 1qsuX5-00FlAN-Cv for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Oct 2023 00:35:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsuX5-00FlAE-2n for pgsql-hackers@lists.postgresql.org; Wed, 18 Oct 2023 00:35:31 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qsuWy-0010Ee-M1 for pgsql-hackers@postgresql.org; Wed, 18 Oct 2023 00:35:30 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9D5765C0324; Tue, 17 Oct 2023 20:35:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 17 Oct 2023 20:35:23 -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:sender :subject:subject:to:to; s=fm3; t=1697589323; x=1697675723; bh=Av glxKmyUDnK1cnfB+CdfQXmNTUMncjEscRHrV5nJXQ=; b=qeFM+92NqGV5BFP11Z fXY3DGBQDUzyNWl2wwwIyoluBP4oFcOHXkxOdsOrMIjsl3dGsu+JEp1HTAx6rcn1 YSWujOABGVJwOc7PFV6IZgk0ZkNt9lLJ5EXUe0byLf1K8iWc3lEvKQa/h7iKafq8 1j3CaxwylZHad8ZrdEWecyKcmdJP8qpt6QkWXvU2JuXdHKnrgxNN4ez1QUWxkBVO sWvDUpTRk59ns4HTmLa1POVWt7s9AZfT0zkY3okqQNHfxxYBShCrzoZ83rVD23jp MOK0keZdTeDzoUEvSDOBUbKuiATmBiSTC7wEvcE3+wz3q2CItpiezcUHIMup760O p0/g== 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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1697589323; x=1697675723; bh=AvglxKmyUDnK1 cnfB+CdfQXmNTUMncjEscRHrV5nJXQ=; b=iysw2F97NMiBwEJuGE2FYsnMrxdKB Om94tf2r/V7tOJX/Ah4HwjBTTmW9V9j1WrZYvOVyILhsfWFuvd4/tFFt//Gi+33L 6aW29dwQKGfseWSIdGHf/FqVGGZYnTSfjzTM2dpKgO8Pehk40f1vX9/SSA7qbv1P fuRqnzOFz+kxzeMJxFcmgTCo/KuFhtLOEVBqlGbW9ARYM82KqcgafEpbStZWRQM/ 4LbGOlb2UEjFpRcmutKQOwg6pBNNF6RUKmDyFy41WoCF3KzXRoNbBSTwcgU5z4lO HIwZMzPBwAWVyVUfKA+yO5nfazMOrhJr/lexJrXl401o5+V5tCKH3ehZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeefgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdefhedmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddt jeenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeejieegheevjedvgeektdegveej ueegheeljeeggeffvdfhjeefffeigfejjedvfeenucffohhmrghinhepphhoshhtghhrvg hsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 17 Oct 2023 20:35:21 -0400 (EDT) Date: Wed, 18 Oct 2023 09:35:17 +0900 From: Michael Paquier To: Robert Haas Cc: Andres Freund , Dilip Kumar , Heikki Linnakangas , pgsql-hackers Subject: Re: New WAL record to detect the checkpoint redo location Message-ID: References: <20230714151626.rhgae7taigk2xrq7@awork3.anarazel.de> <20231005183400.n5myso7vu6crd656@alap3.anarazel.de> <20231009204702.cy3ilp6wgh7a5qms@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5IP3FdTzgaNtzLjg" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --5IP3FdTzgaNtzLjg Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 17, 2023 at 12:45:52PM -0400, Robert Haas wrote: > On Fri, Oct 13, 2023 at 3:29=E2=80=AFAM Michael Paquier wrote: >> I've mentioned as well a test in pg_walinspect after one of the >> checkpoints generated there, but what you do here is enough for the >> online case. >=20 > I don't quite understand what you're saying here. If you're suggesting > a potential improvement, can you be a bit more clear and explicit > about what the suggestion is? Suggestion is from here, with a test for pg_walinspect after it runs its online checkpoint (see the full-page case): https://www.postgresql.org/message-id/ZOvf1tu6rfL/B2PW@paquier.xyz +-- Check presence of REDO record. +SELECT redo_lsn FROM pg_control_checkpoint() \gset +SELECT start_lsn =3D :'redo_lsn'::pg_lsn AS same_lsn, record_type + FROM pg_get_wal_record_info(:'redo_lsn'); >> Then repeat this pattern for non-shutdown checkpoints a few lines down >> without touching the copy of the redo LSN in XLogCtl->Insert, because >> of course we don't hold the WAL insert locks in an exclusive fashion >> here: >> checkPoint.redo =3D RedoRecPtr; >> >> My point is that this is not only about RedoRecPtr, but also about >> XLogCtl->Insert.RedoRecPtr here. The comment in ReserveXLogSwitch() >> says that. >=20 > I have adjusted the comment in CreateCheckPoint to hopefully address > this concern. - * XLogInsertRecord will have updated RedoRecPtr, but we need to co= py - * that into the record that will be inserted when the checkpoint is - * complete. + * XLogInsertRecord will have updated XLogCtl->Insert.RedoRecPtr in + * shared memory and RedoRecPtr in backend-local memory, but we need + * to copy that into the record that will be inserted when the + * checkpoint is complete.=20 This comment diff between v8 and v9 looks OK to me. Thanks. > I don't understand what you mean about > ReserveXLogSwitch(), though. I am not sure either, looking back at that :p -- Michael --5IP3FdTzgaNtzLjg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmUvKEUACgkQnvQgOdby QH2geg//U71YHOn2V9uizYEE69SqqKBnivSrgNswAenN/XrcMfpADtDEfE7U+uZH lmJo1Gg+qIUPt4Qpl7/2dObCrWa4pS/O/S791UlUoY4vUsrqPRQgqa6m8XYP5TQR jOP+F04T4Wf4o+ACz244sCvXId93/S5z5S2xQF46w7PuZzChNCmgK9hwud171+Kb NR6hpwxuDy6Fu+YG7yAUqiIKbRkTvop9HUT/VWJXH8EhHnh5r/0NjSsQMinvzfXB SvKkmkasGhhcSufo0Os367K40kcrONI0+YiipGTZSRtWONJTlr+x0fQzeCgSO50f +GPpLjBMZ/rcuKGR5J//eVPNoAihYKPVpnX8lCrzjQ75lo1hCr7h7XJ/xkgWDR6Q zH+8Pf9DoJSuAcAiC+Ftoj4am64DZi8uyYcYpTbrMSHts4XqjDV9RC4LelZnJ3xc Fb4q+nHZrfRbbVioh4HOd+a9+aAWUMgodueXh8Ew2rkPZSd20yOauzV9SYS73Zcl 4+UbXDF8e9/p6TwMc+iPkcDkqe6olbKM8zqAerH/MB1svIe0M3nsuQEsv8ykygIo 6mdgStpoY74zAy/wVgupUbzappOsrv3hYhsYVZLsqnefr0x7QzEfPwBAIHiA6RLn l0GSnah8Q34cvmiNck3JVBEBWKYIpemue6B0FSe6PV6Ouz3W5bs= =G7D4 -----END PGP SIGNATURE----- --5IP3FdTzgaNtzLjg--