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

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: logical replication: could not create file "state.tmp": File exists
Date: 2020-05-25 20:35:41
Message-ID: 20200525203541.GA13908@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2019-Nov-30, Grigory Smolkin wrote:

> One of my colleagues encountered an out of space condition, which broke his
> logical replication setup.
> It`s manifested with the following errors:
>
> ERROR:  could not receive data from WAL stream: ERROR:  could not create
> file "pg_replslot/some_sub/state.tmp": File exists

We haven't addressed this problem, have we? At least, I see that this
routine still looks like this:

> diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
> index 21ae8531b3..ef415b44c8 100644
> --- a/src/backend/replication/slot.c
> +++ b/src/backend/replication/slot.c
> @@ -1253,7 +1253,7 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
> sprintf(tmppath, "%s/state.tmp", dir);
> sprintf(path, "%s/state", dir);
>
> - fd = OpenTransientFile(tmppath, O_CREAT | O_EXCL | O_WRONLY | PG_BINARY);

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2020-05-26 00:19:43 Re: BUG #16380: documentation: host[no]gssenc vs. address/IP-address/IP-mask fields
Previous Message PG Bug reporting form 2020-05-25 19:54:39 BUG #16461: Segfault in autovacuum process