Re: Add pg_file_sync() to adminpack

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Add pg_file_sync() to adminpack
Дата
Msg-id CAHGQGwGjR=wM1NwT67gADZwFpU+X59H=pVELDz_d2sC7_j=NkA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Add pg_file_sync() to adminpack  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Add pg_file_sync() to adminpack
Список pgsql-hackers
On Wed, Dec 25, 2019 at 11:11 PM Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> On Wed, Dec 25, 2019 at 2:01 PM Fujii Masao <masao.fujii@gmail.com> wrote:
> >
> > Hi,
> >
> > I'd like to propose to add pg_file_sync() function into contrib/adminpack.
> > This function fsyncs the specified file or directory named by its argument.
> > IMO this is useful, for example, when you want to fsync the file that
> > pg_file_write() writes out or that COPY TO exports the data into,
> > for durability. Thought?
>
> +1, that seems like a useful wrapper.  Looking at existing functions,
> I see that there's a pg_file_rename() in adminpack, but it doesn't use
> durable_rename nor does it try to perform any fsync.  Same for
> pg_file_unlink vs. durable_unlink.  It's probably worth fixing that at
> the same time?

I don't think that's a bug. I'm not sure if every users of those functions
need durable rename and unlink at the expense of performance.
So IMO it's better to add new argument like "durable" to those functions
and durable_rename or _unlink is used only if it's true.

Regards,

-- 
Fujii Masao



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Следующее
От: Dilip Kumar
Дата:
Сообщение: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions