Re: Wrong return code in vacuumdb when multiple jobs are used

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Wrong return code in vacuumdb when multiple jobs are used
Дата
Msg-id 20190504091504.GF2174@paquier.xyz
обсуждение исходный текст
Ответ на Wrong return code in vacuumdb when multiple jobs are used  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: Wrong return code in vacuumdb when multiple jobs are used  (Julien Rouhaud <rjuju123@gmail.com>)
Re: Wrong return code in vacuumdb when multiple jobs are used  (Amit Kapila <amit.kapila16@gmail.com>)
Список pgsql-hackers
On Sat, May 04, 2019 at 10:35:23AM +0200, Julien Rouhaud wrote:
> While reading vacuumdb code, I just noticed that it can return 0 if an
> error happen when -j is used, if errors happen on the last batch of
> commands.

Yes, I agree that this is wrong.  GetIdleSlot() is much more careful
about that than vacuum_one_database(), so your patch looks good at
quick glance.

> This behavior exists since 9.5.  Trivial patch attached.  I'm not sure
> that a TAP test is required here, so I didn't add one.  I'll be happy
> to do so though if needed.

You could make that reliable by getting a lock on a table using a
two-phase transaction, and your test case from upthread won't fly high
as we have no facility in PostgresNode.pm to keep around a session's
state using psql.  FWIW, I am not convinced that it is a case worth
bothering, so no tests is fine.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Inconsistent error message wording for REINDEX CONCURRENTLY
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: Wrong return code in vacuumdb when multiple jobs are used