Re: Patch to improve reliability of postgresql on linux nfs

Поиск
Список
Период
Сортировка
От Aidan Van Dyk
Тема Re: Patch to improve reliability of postgresql on linux nfs
Дата
Msg-id CAC_2qU_6dfZKg4Dc0dH+kCu=Kt8WWPmaeQ_Amg=G3r99P-nvTA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Patch to improve reliability of postgresql on linux nfs  (Florian Pflug <fgp@phlo.org>)
Ответы Re: Patch to improve reliability of postgresql on linux nfs
Список pgsql-hackers
On Tue, Sep 13, 2011 at 7:30 AM, Florian Pflug <fgp@phlo.org> wrote:

>
> Sorry for the self-reply. I realized only after hitting send that I
> got the ENOSPC handling wrong again - we probably ought to check for
> ENOSPC as well as ret == 0. Also, it seems preferable to return the
> number of bytes actually written instead of -1 if we hit an error during
> retry.
>
> With this version, any return value other than <amount> signals an
> error, the number of actually written bytes is reported even in the
> case of an error (to the best of pg_write_nointr's knowledge), and
> errno always indicates the kind of error.

Personally, I'ld think that's ripe for bugs.   If the contract is that
ret != amount is the "error" case, then don't return -1 for an error
*sometimes*.

If you sometimes return -1 for an error, even though ret != amount is
the *real* test, I'm going to guess there will be lots of chance for
code to do: if (pg_write_no_intr(...) < 0)  ...

which will only catch some of the errors, and happily continue with the rest...

a.

--
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.


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

Предыдущее
От: "ktm@rice.edu"
Дата:
Сообщение: Re: Patch to improve reliability of postgresql on linux nfs
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: timezone GUC