Re: Allowing WAL fsync to be done via O_SYNC

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Allowing WAL fsync to be done via O_SYNC
Дата
Msg-id 16027.984697876@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Allowing WAL fsync to be done via O_SYNC  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> switch(lower(string[0]) + lower(string[5]))
> {
>     case 'f':    /* fsync */
>     case 'f' + 's':    /* fdatasync */
>     case 'o' + 's':    /* open_sync */
>     case 'o' + 'd':    /* open_datasync */
> }

> Although ugly, it should serve as a readable solution for now.

Ugly is the word ...

>> Do you object if I add an "assign_hook" to guc.c that's called when an
>> actual assignment is made?

> Something like this is on my wish list, but I'm not sure if it's wise to
> start this now.

I'm not particularly concerned about changing the interface later if
that proves necessary.  We're not likely to have so many of the things
that an API change is burdensome, and they will all be strictly backend
internal.

What I have in mind for now is just
void (*assign_hook) (const char *newval);

(obviously this is for string variables only, for now) called just
before actually changing the variable value.  This lets the hook see
the old value if it needs to.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Allowing WAL fsync to be done via O_SYNC
Следующее
От: Alfred Perlstein
Дата:
Сообщение: Re: Allowing WAL fsync to be done via O_SYNC