Re: pg_recvlogical prints bogus error when interrupted

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: pg_recvlogical prints bogus error when interrupted
Дата
Msg-id ZKuMvRieHr4YHLcw@paquier.xyz
обсуждение исходный текст
Ответ на Re: pg_recvlogical prints bogus error when interrupted  ("Tristan Partin" <tristan@neon.tech>)
Ответы Re: pg_recvlogical prints bogus error when interrupted
Список pgsql-hackers
On Thu, Jul 06, 2023 at 10:29:10AM -0500, Tristan Partin wrote:
> On Thu Apr 27, 2023 at 12:54 AM CDT, Bharath Rupireddy wrote:
>> Why do we need both time_to_abort and ready_to_exit?
>
> I am trying to understand why we need both as well. Maybe I am missing
> something important :).

As StreamLogicalLog() states once it leaves its main loop because
time_to_abort has been switched to true, we want a clean exit.  I
think that this patch is just a more complicated way to avoid doing
twice the operations done by prepareToTerminate().  So how about
moving the prepareToTerminate() call outside the main streaming loop
and call it when time_to_abort is true?  Then, I would suggest to
change the keepalive argument of prepareToTerminate() to an enum able
to handle three values to log the reason why the tool is stopping: the
end of WAL, an interruption or a keepalive when logging.  There are
two of them now, but we want a third mode for the signals.

> > /* It is not unexepected termination error when Ctrl-C'ed. */
>
> My only other comment is that it would be nice to have the word "an"
> before unexpected.

s/unexepected/unexpected/.  Still, it seems to me that we don't need
this comment.
--
Michael

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.
Следующее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: Autogenerate some wait events code and documentation