Here is an updated patch set with the following changes:
* The creation of the struct for non-shared WAL receiver state is moved to
a prerequisite 0001 patch. This should help ease review of 0002 a bit.
* I updated the nap time calculation to round up to the next millisecond,
as discussed upthread.
* I attempted to minimize the calls to GetCurrentTimestamp(). The WAL
receiver code already calls this function pretty liberally, so I don't know
if this is important, but perhaps it could make a difference for systems
that don't have something like the vDSO to avoid real system calls.
* I removed the 'tli' argument from functions that now have an argument for
the non-shared state struct. The 'tli' is stored within the struct, so the
extra argument is unnecessary.
One thing that still bugs me a little bit about 0002 is that the calls to
GetCurrentTimestamp() feel a bit scattered and more difficult to reason
about. AFAICT 0002 keeps 'now' relatively up-to-date, but it seems
possible that a future change could easily disrupt that. I don't have any
other ideas at the moment, though.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com