Re: ThisTimeLineID can be used uninitialized

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: ThisTimeLineID can be used uninitialized
Дата
Msg-id YXD9fDgWjRgIQVbw@paquier.xyz
обсуждение исходный текст
Ответ на Re: ThisTimeLineID can be used uninitialized  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: ThisTimeLineID can be used uninitialized
Список pgsql-hackers
On Wed, Oct 20, 2021 at 09:08:57AM -0400, Robert Haas wrote:
> On Tue, Oct 19, 2021 at 7:30 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>>> Istm we should introduce an InvalidTimeLineID, and explicitly initialize
>>> sendTimeLine to that, and assert that it's valid / invalid in a bunch of
>>> places?
>>
>> That's not a bad idea; it'll help discover bogus code.  Obviously, some
>> additional tests wouldn't harm -- we have a lot more coverage now than
>> in embarrasingly recent past, but it can still be improved.
>
> +1.

There is already an assumption in walsender.c where an invalid
timeline is 0, by the way?  See sendTimeLineNextTLI and sendTimeLine.
Asserting here and there looks like a good thing to do for code paths
where the timeline should, or should not, be set.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_receivewal starting position
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: [Bug] Logical Replication failing if the DateStyle is different in Publisher & Subscriber