Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ieuXT-0001Ca-Cp for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Dec 2019 05:27:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ieuXR-0008V0-LR for pgsql-bugs@arkaria.postgresql.org; Wed, 11 Dec 2019 05:27:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ieuXR-0008Ut-9l for pgsql-bugs@lists.postgresql.org; Wed, 11 Dec 2019 05:27:53 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ieuXO-00085X-VP for pgsql-bugs@postgresql.org; Wed, 11 Dec 2019 05:27:52 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id EF53022335; Wed, 11 Dec 2019 00:27:49 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 11 Dec 2019 00:27:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=tKVif7DpEKiDuqZMvDv8k3IlcMD 1hCakVegrHAlR88E=; b=cRvF3/iC2Rut6+InCmUR7Cmebyq4AnmPe/WxCl23EWc A36uVVnaNw3u60sWU44Lfu4+3YlOhDKYlt7SwnXNPl02CGjErnrkIDHLSQxOGf4v n8IkC+I597LumdfkdtNc40kX2qIhjT37ASCATo38rrYJ2UWcOt6s1KpixHDH8snY G9j2+BEpP5qfmx1kRiRoc80VZLnS0m+OP3Ag92CfUW7WJ/znnmC7MaZSKcEbqNg6 MXbnZ2zVrSiF5kdJjROzqyrSjUrK8x0WISTTmiq7N/8cUTqE2oLI88gl1qYK8iLp QMW1n5h636R9jl95pJUTJ84t/PY4eJnHvcw5SG7c1ig== 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-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=tKVif7 DpEKiDuqZMvDv8k3IlcMD1hCakVegrHAlR88E=; b=njOAT5Un2Ac0CgviSUVEyb VqXqBU57l3GL9HzSldPAYQThMEyVGIbertXPuitF/JHIL3COv5Y+tda+Ei9oN5Kf Io770OkB/7BKueMU0ggthrYayMuxHVXVnNDxv9rlBikdno864ZJo6nRnOhvHCJe2 44WvitDfeJOJzIzpFXdBNZ5lwjMrUBSak2Wq/E0AAiB+sy66Ljujj7hnsD+IPegz /NpnL2/vborkUisv7+Kp2LeGrZ7QzWlV2m2NKDDGnFsnmcG0I8NUdO8tPGnWZYCr 0X+B0fyb8jyU9g01RIREmSI9fyGOuHHShtFUO6I7Qvv1L8bukNh0hWBK1JCCcFRA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudelgedgjeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucfkphepuddukedrvdeguddrvdehtddrkeehnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (mp76f1fa55.ap.nuro.jp [118.241.250.85]) by mail.messagingengine.com (Postfix) with ESMTPA id 1748430600D7; Wed, 11 Dec 2019 00:27:47 -0500 (EST) Date: Wed, 11 Dec 2019 14:27:45 +0900 From: Michael Paquier To: Andres Freund Cc: Grigory Smolkin , Pg Bugs Subject: Re: logical replication: could not create file "state.tmp": File exists Message-ID: <20191211052745.GL72921@paquier.xyz> References: <08bbfab1-a61d-3750-fc18-4ab2c1aa7f09@postgrespro.ru> <20191202161222.sazl2omhhk5pl3nl@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="R+Rs1qz93vBJxC1z" Content-Disposition: inline In-Reply-To: <20191202161222.sazl2omhhk5pl3nl@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --R+Rs1qz93vBJxC1z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 02, 2019 at 08:12:22AM -0800, Andres Freund wrote: > I'm very doubtful about this. I think it's a good safety measure to > ensure that there's no previous state file that we're somehow > overwriting. During the checkpoint of replication slots, SaveSlotToPath() would just *LOG* any failure while leaving around the state.tmp of a slot, and then any follow-up attempt to create state.tmp would just fail because of that, preventing the slot state file from being flushed continuously. I think that's wrong. Concurrency is not a concern either here as the slot's LWLock to track an I/O in progress is taken in exclusive lock.=20 -- Michael --R+Rs1qz93vBJxC1z Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl3wflEACgkQnvQgOdby QH1TUg//a5ucSF1lPMUv8vIWwRUUptL02QnLWHtkmK2T1EtzVk/pcNpduyXmAE76 vudCbGXdK+r21qN9tVYjwz9PGuRUTTbRGwm+jqh1uxj6iVfw4G7xFKMasy/K7A+t CVl8B/ULCOWfWpv4FlEbeA5llxALD+xqEFmLEhW6844YxXFY86vxWkIqjBJugbBD kG/ACZ23/yMmRGWManbkJDg5LQVTTTcm4jcfdEcd5jPXQB3vosLc5wnq5u6Oj6nQ oaoXYCZe5q7GzLpIidrIqH91nb1Gs2ye2prPJPRpk4lWqdaItsqAApm5yQGqyATs WmQbCXcAl37q7bgTjWzstNVSeD7qewdG/o5XniM9CagoC5CZ2UsrxITWcCf5RjKe PoYyXWCnxpcw0add/j0A8DXuAZ/DHtY14q59GQdxkqUlccKDqy0AhMho7kTHOySF KFgs1kJQaEsKNR9OoOIQp88nbFj9axkI4uxavFT1AbM5gL0n/5xJpkoqcBok0uBM pgxuqKtHB42XumGWTmlF0qK+QydEUSGFLMDRoOlIRI3S2Lg5gEXWem7mhOK3B+0m vI1dYIyXmFmqjpDzMBFQMjTKyr+8/q93c3tfS5DeONT3Yhu6fStMe1iy1M7tUpTH fHyuosADarEAaZ/q1zWfmV7BaGz28imUxmrFyuNDvifKLe2kcls= =wqFV -----END PGP SIGNATURE----- --R+Rs1qz93vBJxC1z--