Re: [HACKERS] Orphaned files in base/[oid]

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [HACKERS] Orphaned files in base/[oid]
Дата
Msg-id CAB7nPqT3__WF0BN5hZYKVch4HrvOeTzi+9B7c33kqZnGTbcDNw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Orphaned files in base/[oid]  (Andres Freund <andres@anarazel.de>)
Ответы Re: [HACKERS] Orphaned files in base/[oid]  (Chris Travers <chris.travers@adjust.com>)
Список pgsql-hackers
On Tue, Aug 15, 2017 at 3:56 AM, Andres Freund <andres@anarazel.de> wrote:
> I think there are some possibilities to close the gap here. We could
> e.g. have <relfilenode>.delete_on_crash marker files that get installed
> when creating a new persistent relfilenode. If we set up things so they
> get deleted post commit, but inside the critical section, we could rely
> on them being present in case of crash, but consistently removed during
> WAL replay. At the end of recovery, iterate over the whole datadir and
> nuke all relations with marker files present.

I agree that an approach like that has value for the problem defined
in this thread.

> I first thought that'd cost an additional fsync per relation
> created. But I think we actually can delay that to a pre-commit phase,
> if we have XLOG_SMGR_CREATE create those markers via a flag, and fsync
> them just before checkpoint (via the usual delayed fsync mechanism).
> That'd still require an XLogFlush(), but that seems hard to avoid unless
> we just don't create relations on FS level until buffers are
> evicted and/or BufferSync().

Yeah, that should work as well.
-- 
Michael



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

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: [HACKERS] [postgresql 10 beta3] unrecognized node type: 90
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] reload-through-the-top-parent switch the partition table