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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: logical replication: could not create file "state.tmp": File exists
Date: 2019-12-11 05:27:45
Message-ID: 20191211052745.GL72921@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message vignesh C 2019-12-11 05:43:04 Re: Reorderbuffer crash during recovery
Previous Message Alexander Lakhin 2019-12-11 05:00:00 Re: BUG #16154: pg_ctl restart with a logfile fails sometimes (on Windows)