Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etOA7-00067m-D7 for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Mar 2018 01:46:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1etOA5-0004e9-On for pgsql-bugs@arkaria.postgresql.org; Wed, 07 Mar 2018 01:46:33 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1etOA5-0004dz-IH for pgsql-bugs@lists.postgresql.org; Wed, 07 Mar 2018 01:46:33 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1etOA3-0000gK-2Q for pgsql-bugs@postgresql.org; Wed, 07 Mar 2018 01:46:33 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id AAF53100C; Tue, 6 Mar 2018 20:46:29 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Tue, 06 Mar 2018 20:46:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=ixJIcXTtC49noNjdPiFJKy6WIT3vZVDbZNLzhqK3Ze8=; b=NFS7C78e foAMvYGTdtP0M9/PF5wFtYul3ht/kmsap7hwX8Ty5RN6IyrGV6UI+9eaTqD8cHK0 frFmh6Ezr2CqIKhfIv0PaWJk+tUfrLDFe4U5zvflgHHfNrVeI+ZCYweA0wVodNt7 /toJhyLDFzIYvDJT9NAadx3kD4QWwLVA75TFz7G5pPF2rMFaEqQ4XOrh/2T5kb13 vw4n8r7JnOr7OnATwxLeeEuO+3rsVDTlN7mukyIT/h93IUKMaef+AMJenw9qXemR I/CkRFpnYAImR3kiMWVRV0F13am8RUOTlRAWGM1A9IxaSXE1LEu8OWnGHOIPHzq7 VS76lZqebQVKtA== 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-sender :x-me-sender:x-sasl-enc; s=fm2; bh=ixJIcXTtC49noNjdPiFJKy6WIT3vZ VDbZNLzhqK3Ze8=; b=QeJHZyRVOuSSRZwLIrs8YOlTx/2J8cKCPIYlm9l+bF6Qk +xboIhRPsisHdT+cZapXK1os34SjCusiWi2WVSux2BP4veogmKAlDJuBH4ebBabz 0GV/2+gILan4zgCqDO+N5u9JHc9eJmtLmEIHtelVz6xGN94u0mWhHJGL86Q7NuIG oFbB2AYavDFHzeBX3/iXY9yhqK3OFoZxMBo8Aet+lO0JAuY/j1c/WB3OvnfQeEEt s93CPmjXnwF0469G+8zYPFt+pjSODv0YPMs1W3YAmD3l5gY0E3oCgudMmDIEf2N7 v1H2N3+NNGP6uh/xsmdKHBJktkRICBwwvzRR2Fqiw== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 498FE24805; Tue, 6 Mar 2018 20:46:27 -0500 (EST) Date: Wed, 7 Mar 2018 10:46:24 +0900 From: Michael Paquier To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Masahiko Sawada , TipTop Labs , Michael Paquier , PostgreSQL mailing lists Subject: Re: BUG #14999: pg_rewind corrupts control file global/pg_control Message-ID: <20180307014624.GC1744@paquier.xyz> References: <0D104D1E-6103-49F4-8AB8-B5CD92949E18@tiptop-labs.com> <20180115072537.GC1724@paquier.xyz> <20180227012441.GB3255@paquier.xyz> <20180305075431.GH2266@paquier.xyz> <20180305090111.GI2266@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OBd5C1Lgu00Gd/Tn" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --OBd5C1Lgu00Gd/Tn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Mar 06, 2018 at 09:37:34PM +0100, Dmitry Dolgov wrote: > Thank you for waiting. Yes, it also looks good for me, but I'm wondering about > one thing - does it make sense to think about other error codes here, not only > about `EACCESS`? E.g. if a file was removed during the process (so, it should > be `ENOENT`), or something more exotic happened, like there are too many > symbolic links were encountered in resolving a pathname (`ELOOP`)? The presence of the file is ensured in the pre-phase which builds the file map (see process_source_file), and actions are taken depending on the presence of a file on the source and the target. So a file missing on the target after those pre-checks have ensured that it was actually existing should be reported with ENOENT. ELOOP would as well be faced on the backend before seeing it in pg_rewind, no? In short, it seems to me that it is better to keep the code simple. -- Michael --OBd5C1Lgu00Gd/Tn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlqfRHAACgkQnvQgOdby QH38tg//TjobBesr3q0ftYqHB3tXfMLpHBpgM+SoWAHjSxFwvn7e6begQhf/jPqw 71/UBQgPTjJu3TOOBYuIdmQ5qLhpITQB1nz15hhfrJZVSbJrKukDsbZR1XubY16i vrdMSybdfcLEDWWKBxR/faLcH+OvAS63ipGSJUmQ1bTzE4QIUuA0JbUD49Ss1Oql qMR54MXhMEQsHzhnu/5fXAP4cRy8fMUIqIXag5IkkH5tDqQIhSsj1y0ixdnuuetN t3MMoEgISn3O8PogWnxwpZ0OudtS3zMR1k/d/FLUtER8eilfZ1l4Z5r/Cnr7MsWD wZ+NG+kMOR190qKDBtPd61AjdRkrFJ0KX9cRNvQEr7l1VS+mXizK0QIYV6J4CY03 h9kYVmYSfSEu4D6/MK+ZeS+C8v501TbDh0Rr9Qw+oM04prGkQ7g/dlG/PHo4mJap +zt9SYkpPHL8MXz2A9swGtewQxrCIK4vumCkGWeLn3oWhieGy7hz3L0O4AKYXJaq Xy8waKnLXe0I5PRXnaiF2IreBMWV7VGZjVDuZ4jZdLjVBv53gDYeVqJ9rb9yx8dY lOjekad+Bu6ULj9ayRC+bHNx3UDMX6AZ3dFdLIKPXTt6nsliAPS9peSMz5uKOlXF jO8zOadobo0gMU6gyjbHVEim7uOFJzWsxWQiZUMQ7VHbZpKNntI= =TWGo -----END PGP SIGNATURE----- --OBd5C1Lgu00Gd/Tn--