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

Поиск
Список
Период
Сортировка
От Grigory Smolkin
Тема logical replication: could not create file "state.tmp": File exists
Дата
Msg-id 08bbfab1-a61d-3750-fc18-4ab2c1aa7f09@postgrespro.ru
обсуждение исходный текст
Ответы Re: logical replication: could not create file "state.tmp": Fileexists  (Michael Paquier <michael@paquier.xyz>)
Re: logical replication: could not create file "state.tmp": Fileexists  (Andres Freund <andres@anarazel.de>)
Re: logical replication: could not create file "state.tmp": Fileexists  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-bugs
Hello!

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

I`ve digged a bit into this problem, and it`s turned out that in 
SaveSlotToPath() temp file for replication slot is opened with 'O_CREAT 
| O_EXCL' flags, which makes this routine as not very reentrant.

Since an exclusive lock is taken before temp file creation, I think it 
should be safe to replace O_EXCL with O_TRUNC.
Script to reproduce and patch are attached.

-- 
Grigory Smolkin
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Strange query planner behavior
Следующее
От: Martin Querleu
Дата:
Сообщение: Re: Strange query planner behavior