Re: Patch to improve reliability of postgresql on linux nfs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Patch to improve reliability of postgresql on linux nfs
Дата
Msg-id 5314.1315923915@sss.pgh.pa.us
обсуждение исходный текст
Ответ на 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
Florian Pflug <fgp@phlo.org> writes:
> On Sep13, 2011, at 15:05 , Aidan Van Dyk wrote:
>> 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*.

> Hm, but isn't that how write() works also?

Yeah.  It's not possible to maintain the same error-reporting contract
that bare write() has got, unless you're willing to forget about actual
errors reported by a non-first write attempt.  Which might not be
totally unreasonable, because presumably something similar is going on
under the hood within write() itself.  Most of the errors one might
think are worth reporting would have had to occur on the first write
attempt anyway.

But if you do want to report such errors, I think you have to push the
error reporting logic into the subroutine, which seems a bit messy since
there's quite a variety of error message phrasings out there, all of
which require information that write() itself does not have.  Also, we
do *not* want e.g. gettext() to be invoked unless an error actually
occurs and has to be reported.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SSL key with passphrase
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: augmenting MultiXacts to improve foreign keys