Re: logical replication: could not create file "state.tmp": File exists
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Michael Paquier <michael@paquier.xyz>
Cc: Grigory Smolkin <g.smolkin@postgrespro.ru>, Pg Bugs <pgsql-bugs@postgresql.org>
Date: 2019-12-11T17:40:11Z
Lists: pgsql-bugs
Hi, On 2019-12-11 14:27:45 +0900, Michael Paquier wrote: > 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. I'm not clear on what you're saying? I don't see how I'm arguing for the type of behaviour you seem to be describing? Greetings, Andres Freund
Commits
-
Remove state.tmp when failing to save a replication slot
- c878d9808420 13.23 landed
- f57f2760e665 14.20 landed
- 0adf424b490b 15.15 landed
- bfdd1a12d2d9 16.11 landed
- 42348839d8b7 17.7 landed
- 9a6ea00ac8c0 18.1 landed
- 912af1c7e9c9 19 (unreleased) landed