Re: logical replication: could not create file "state.tmp": File exists

Michael Paquier <[email protected]>
Newsgroups gmane.comp.db.postgresql.bugs
Message-ID <[email protected]>
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. 
--
Michael
signature.asc (application/pgp-signature, 833 B)
-----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-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.