Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-30 Thread Andres Freund
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_baseb

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-30 Thread Andres Freund
Hi, On 2022-01-30 16:51:12 +0100, Magnus Hagander wrote: > On Sat, Jan 29, 2022 at 10:47 PM Andres Freund wrote: > > > > Hi, > > > > On 2022-01-29 12:44:22 -0800, Andres Freund wrote: > > > On 2022-01-17 10:06:56 -0800, Andres Freund wrote: > > > > Yes, that's what I was suggesting. I wasn't thin

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-30 Thread Magnus Hagander
On Sat, Jan 29, 2022 at 10:47 PM Andres Freund wrote: > > Hi, > > On 2022-01-29 12:44:22 -0800, Andres Freund wrote: > > On 2022-01-17 10:06:56 -0800, Andres Freund wrote: > > > Yes, that's what I was suggesting. I wasn't thinking of using a static > > > var, > > > but putting it in StreamCtl. No

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-30 Thread Magnus Hagander
On Sat, Jan 29, 2022 at 9:44 PM Andres Freund wrote: > > On 2022-01-17 10:06:56 -0800, Andres Freund wrote: > > Yes, that's what I was suggesting. I wasn't thinking of using a static var, > > but putting it in StreamCtl. Note that what pgwin32_waitforsinglesocket() > > is doing doesn't protect aga

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-29 Thread Andres Freund
Hi, On 2022-01-29 12:44:22 -0800, Andres Freund wrote: > On 2022-01-17 10:06:56 -0800, Andres Freund wrote: > > Yes, that's what I was suggesting. I wasn't thinking of using a static var, > > but putting it in StreamCtl. Note that what pgwin32_waitforsinglesocket() > > is doing doesn't protect aga

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-29 Thread Andres Freund
On 2022-01-17 10:06:56 -0800, Andres Freund wrote: > Yes, that's what I was suggesting. I wasn't thinking of using a static var, > but putting it in StreamCtl. Note that what pgwin32_waitforsinglesocket() > is doing doesn't protect against the problem referenced above, because it > still is reset b

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-17 Thread Andres Freund
Hi, On 2022-01-17 14:50:27 +0100, Magnus Hagander wrote: > On Mon, Jan 17, 2022 at 12:31 AM Andres Freund wrote: > > > > 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

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-17 Thread Magnus Hagander
On Mon, Jan 17, 2022 at 12:31 AM Andres Freund wrote: > > 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(), othe

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-16 Thread Andres Freund
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 ha

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-16 Thread Andres Freund
Hi, On 2022-01-16 17:39:11 +0100, Magnus Hagander wrote: > On Sun, Jan 16, 2022 at 5:36 PM Magnus Hagander wrote: > > > > On Sun, Jan 16, 2022 at 5:34 PM Tom Lane wrote: > > > > > > Andres Freund writes: > > > > I don't immediately see a solution for this, other than to add > > > > StreamCtl->s

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-16 Thread Magnus Hagander
On Sun, Jan 16, 2022 at 5:36 PM Magnus Hagander wrote: > > On Sun, Jan 16, 2022 at 5:34 PM Tom Lane wrote: > > > > Andres Freund writes: > > > I don't immediately see a solution for this, other than to add > > > StreamCtl->stop_event (mirroring ->stop_socket) and then convert > > > CopyStreamPol

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-16 Thread Magnus Hagander
On Sun, Jan 16, 2022 at 5:34 PM Tom Lane wrote: > > Andres Freund writes: > > I don't immediately see a solution for this, other than to add > > StreamCtl->stop_event (mirroring ->stop_socket) and then convert > > CopyStreamPoll() to use WaitForMultipleObjects(). Microsoft's select() > > doesn't

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-16 Thread Tom Lane
Andres Freund writes: > I don't immediately see a solution for this, other than to add > StreamCtl->stop_event (mirroring ->stop_socket) and then convert > CopyStreamPoll() to use WaitForMultipleObjects(). Microsoft's select() > doesn't support pipes and there's no socketpair(). > Any more straig

Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests

2022-01-16 Thread Magnus Hagander
On Sun, Jan 16, 2022 at 10:22 AM Andres Freund wrote: > > Hi, > > I was wondering in [1] what we could do about the slowest tests on > windows. > > On 2021-12-31 11:25:28 -0800, Andres Freund wrote: > > Picking a random successful cfbot run [1] I see the following tap tests > > taking > > more th