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 1nqRhw-0000n9-0g for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2022 03:47:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nqRhu-00027a-RG for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2022 03:47:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqRht-00027P-5l for pgsql-hackers@lists.postgresql.org; Mon, 16 May 2022 03:47:42 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqRhp-0003Q5-Iy for pgsql-hackers@lists.postgresql.org; Mon, 16 May 2022 03:47:40 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7FBF05C0107; Sun, 15 May 2022 23:47:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 15 May 2022 23:47:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc: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=fm1; t=1652672856; x=1652759256; bh=zZLMtpzZPM vxmcdReaQ7hkjAgkrg77NXYsZvT5wT+JA=; b=Z0oxnKQZFjyyRLkbAea1HNo4ld BJPIh2/FGTJbGN8Ygu9MolIWxQte/F4FyK/xu7TSCxguqy9skOWyy0qUrLQTPAKQ 5nq4VOuvTuG+IqoLe5+jt1IxplHhJDtra0OUv5EvVIUutBbmmBZN6cKQtmuBH04J rZcvvk8UQugWMnG7QYoGHy8iD8boQ6Te5B8UXGtz3iPfY8lmOgvaHuJA/trO3Axc 0rkOXHgbfMh8nWliZKqS7jSxnxvOl4bhcA082smdcKjA4UOr535J1WKG/vN8/w6Q 3/JmMuuaygq2X22OGaUK8bGbg2FYk9V3hZCL6BCfiri9rwGjWDNiwUjm1/OQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date: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=fm1; t=1652672856; x= 1652759256; bh=zZLMtpzZPMvxmcdReaQ7hkjAgkrg77NXYsZvT5wT+JA=; b=Z Vfz2J1weJZV/lLIoeTlC9lr1kLV+oaCV7Yq6OqMkLEJJwnTLpo5nQDwv+I4ukW+d /qxJrMpUfPgR809JO6dpnSYz2fOaqLXRqCh4I6nfbsteyw3SygBLGrUcj1QAJgP0 OwOa34+U35RaybPbqNNKr0GIilxYGmr7/CKJOZD/CKAACVg2bn2JDNwZ0bqp6X9I soNBsHC4hzvqSe1NXoYI+Kcv9dhztmyHUARqcl0vHBCsNXIBYIhRf03SR2MsU0up oKYEjNtjyVt/tH0Wkl7JQD3MX79cd4JHDHHhSxPwGklOel0YaTeDOW3iLqB3fI3I elgdozHCmpN6tEY0xyplg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheeggdejjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhepfffhvf evuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcurfgrqhhu ihgvrhcuoehmihgthhgrvghlsehprghquhhivghrrdighiiiqeenucggtffrrghtthgvrh hnpeetleeifedufffhhfdtteelgeeggeffhfekueevteeigfduudevudetgfegiedvjeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthh grvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 15 May 2022 23:47:34 -0400 (EDT) Date: Mon, 16 May 2022 12:47:29 +0900 From: Michael Paquier To: Kyotaro Horiguchi Cc: nathandbossart@gmail.com, pgsql-hackers@lists.postgresql.org, masao.fujii@oss.nttdata.com Subject: Re: Possible corruption by CreateRestartPoint at promotion Message-ID: References: <20220427180945.GA3222843@nathanxps13> <20220428.114357.476887320744154615.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LmgdLG2nXDvdEJN9" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --LmgdLG2nXDvdEJN9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 09, 2022 at 09:24:06AM +0900, Michael Paquier wrote: > Okay, applied this one on HEAD after going back-and-forth on it for > the last couple of days. I have found myself shaping the patch in > what looks like its simplest form, by applying the check based on an > older checkpoint to all the fields updated in the control file, with > the check on DB_IN_ARCHIVE_RECOVERY applying to the addition of > DB_SHUTDOWNED_IN_RECOVERY (got initialially surprised that this was > having side effects on pg_rewind) and the minRecoveryPoint > calculations. It took me some time to make sure that this would be safe, but done now for all the stable branches. > Now, it would be nice to get a test for this stuff, and we are going > to need something cheaper than what's been proposed upthread. This > comes down to the point of being able to put a deterministic stop > in a restart point while it is processing, meaning that we need to > interact with one of the internal routines of CheckPointGuts(). One > fancy way to do so would be to forcibly take a LWLock to stuck the > restart point until it is released. Using a SQL function for that > would be possible, if not artistic. Perhaps we don't need such a > function though, if we could stuck arbitrarily the internals of a=20 > checkpoint? Any ideas? One thing that we could do here is to resurrect the patch that adds support for stop points in the code.. -- Michael --LmgdLG2nXDvdEJN9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmKByVEACgkQnvQgOdby QH32Sg/+ImDU6ZPCNx0CrJsrgLt2mEexPIMAcnTm8/4jeRz5ezXa9EZQ/M0T3PUV Q+g2x5BBPf4wChtoZFzmyYBcB36LzfVKQW4YSJIYd6SZSsK8ddP6cosnnRB9ZC9v L1ou81CLekvhWShDBnzitmAUCK2ka+I3xYra1ifoM5x7HfTf2xphh2nOxZIlD4T+ 2fotv41tv9FSKvJ+5nF88unfow2j2BRwwHkJKYQKKzy0n4HkxfcYAXjosyExv+9p 0821Ji3LNFG+BqTgFSwgaXKJ3JyPrrilb1V3O2lt40uYTB7SEEXro0FL6HsobDGj OLoWPLFipoAkG+gKripzVsFXdbGoX2abxZfHcgbw+j9voSiSy/A2o9NyRUPMKPCj BFiMJkKM+HLVcmWw0AH8A6LDLqSN3QhTbeK0N1SaDzje75O7KkqEuW9KPxtKV7qF V1sNwnwNjHVbVru2L3Gr8FZAW3RPgixyN51z90tMB260Sgz+dHIYFShBjCVlo4Bn 7dGkLdZ8VCxqCelwcFvo2d0W29zoBG5NBSjNkNsz2JcRwLloMK8rlFXqjLNvcMoK bJtX20yQwMOAF+PxaiCD/B+no/uo812SViEDVBJssfsp0dpljtsOI33zJHHxjSYa 7hypiHLGxI9wM4ZGt0b0P0EB+SiWRS/HWCHy3Sm2gqJmm4I6SfY= =6dRf -----END PGP SIGNATURE----- --LmgdLG2nXDvdEJN9--