Re: [HACKERS] Determine if an error is transient by its error code.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Determine if an error is transient by its error code.
Дата
Msg-id 16281.1489980932@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Determine if an error is transient by its error code.  (Craig Ringer <craig@2ndquadrant.com>)
Список pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> On 20 March 2017 at 10:26, Dominick O'Dierno <odiernod@gmail.com> wrote:
>> Essentially I want to determine by the error code if it is worth retrying
>> the call (transient) or if the error was due to a bad query or programmer
>> error, in which case don't retry.

> In general you'll need classes of retry:
> * just reissue the query (deadlock retry, etc)
> * reconnect and retry

Yeah.  There's a pretty significant fraction of these where just blindly
repeating the failing query isn't likely to help; the error code is meant
to suggest that the DBA has to fix something, eg adjust configuration
limits.  I'm also pretty dubious about the value of a blind retry for,
eg, disk_full.

One you missed that I think *is* supposed to imply "just retry" is
40001 serialization_failure.  You have to retry the whole transaction
though, not just one query.
        regards, tom lane



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: [HACKERS] Determine if an error is transient by its error code.
Следующее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] WIP: Faster Expression Processing v4