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 20220116233118.gtczuhiposgncmf2@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>)
Responses Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests
List pgsql-hackers
Hi,

On 2022-01-16 15:28:00 -0800, Andres Freund wrote:
> I hacked that up last night. And a fix or two later, it seems to be
> working. What I'd missed at first is that the event needs to be reset in
> reached_end_position(), otherwise we'll busy loop.
> 
> I wonder if using a short-lived event handle would have dangers of missing
> FD_CLOSE here as well? It'd probably be worth avoiding the risk by creating
> the event just once.
> 
> I just wasn't immediately sure where to stash it. Probably just by adding a
> field in StreamCtl, that ReceiveXlogStream() then sets? So far it's constant
> once passed to ReceiveXlogStream(), but I don't really see a reason why it'd
> need to stay that way?

Oops, attached the patch this time.

Greetings,

Andres Freund

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests
Next
From: Tomas Vondra
Date:
Subject: Re: extended stats on partitioned tables