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