low wal_retrieve_retry_interval causes missed signals on Windows - Mailing list pgsql-hackers

From Nathan Bossart
Subject low wal_retrieve_retry_interval causes missed signals on Windows
Date
Msg-id 20230111061116.GA1668254@nathanxps13
Whole thread Raw
Responses Re: low wal_retrieve_retry_interval causes missed signals on Windows
List pgsql-hackers
I discussed this elsewhere [0], but I thought it deserved its own thread.

After setting wal_retrieve_retry_interval to 1ms in the tests, I noticed
that some of the archiving tests began consistently failing on Windows.  I
believe the problem is that WaitForWALToBecomeAvailable() depends on the
call to WaitLatch() for wal_retrieve_retry_interval to ensure that signals
are dispatched (i.e., pgwin32_dispatch_queued_signals()).  With a low retry
interval, WaitForWALToBecomeAvailable() might skip the call to WaitLatch(),
and the signals are never processed.

The attached patch fixes this by always calling WaitLatch(), even if
wal_retrieve_retry_interval milliseconds have already elapsed and the
timeout is 0.

[0] https://postgr.es/m/20221231235019.GA1223171%40nathanxps13

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

Attachment

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply
Next
From: Peter Smith
Date:
Subject: Re: [DOCS] Stats views and functions not in order?