Re: logical replication: could not create file "state.tmp": Fileexists - Mailing list pgsql-bugs

From Michael Paquier
Subject Re: logical replication: could not create file "state.tmp": Fileexists
Date
Msg-id 20191211052745.GL72921@paquier.xyz
Whole thread Raw
In response to Re: logical replication: could not create file "state.tmp": Fileexists  (Andres Freund <andres@anarazel.de>)
Responses Re: logical replication: could not create file "state.tmp": Fileexists  (Andres Freund <andres@anarazel.de>)
List pgsql-bugs
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

Attachment

pgsql-bugs by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (onWindows)
Next
From: vignesh C
Date:
Subject: Re: Reorderbuffer crash during recovery