Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests - Mailing list pgsql-hackers

From Andres Freund
Subject Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests
Date
Msg-id 20220131004145.ek7bbv2s25aj5gsh@alap3.anarazel.de
Whole thread Raw
In response to Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
Hi,

On 2022-01-29 13:47:13 -0800, Andres Freund wrote:
> Here's a version of the patch only creating the event once. Needs a small bit
> of comment polishing, but otherwise I think it's sane?

Ah, it needs a bit more. I was not cleaning up the event at the exit of
ReceiveXlogStream(). For pg_basebackup that perhaps wouldn't matter, but
pg_receivewal loops...

We don't have a good spot for cleaning up right now. ReceiveXlogStream() has
plenty returns. The attached changes those to a goto done; but pretty it is
not. But probably still the best way for the backbranches?

I think the receivelog.c interface probably could do with a bit of
cleanup... The control flow is quite complicated, with repeated checks all
over etc :(.  And the whole thing with giving the appearance of being
instantiatable multiple times, but then using global variables for state, is
...

Attached a revised version.

Greetings,

Andres Freund

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: plperl on windows
Next
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication