Re: Suppressing useless wakeups in walreceiver - Mailing list pgsql-hackers

From Nathan Bossart
Subject Re: Suppressing useless wakeups in walreceiver
Date
Msg-id 20221016035900.GA1993341@nathanxps13
Whole thread Raw
In response to Re: Suppressing useless wakeups in walreceiver  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Suppressing useless wakeups in walreceiver
List pgsql-hackers
On Thu, Oct 13, 2022 at 12:09:54PM -0700, Nathan Bossart wrote:
> On Thu, Oct 13, 2022 at 12:37:39PM +0200, Alvaro Herrera wrote:
>> The main reason is that it seems odd to have startpointTLI in the struct
>> used in some places together with a file-global recvFileTLI which isn't.
>> The way one is passed as argument and the other as part of a struct
>> seemed too distracting.  This should reduce the number of moving parts,
>> ISTM.
> 
> Makes sense.  Do you think the struct should be file-global so that it
> doesn't need to be provided as an argument to most of the static functions
> in this file?

Here's a different take.  Instead of creating structs and altering function
signatures, we can just make the wake-up times file-global, and we can skip
the changes related to reducing the number of calls to
GetCurrentTimestamp() for now.  This results in a far less invasive patch.
(I still think reducing the number of calls to GetCurrentTimestamp() is
worthwhile, but I'm beginning to agree with Bharath that it should be
handled separately.)

Thoughts?

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

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use -fvisibility=hidden for shared libraries
Next
From: Andres Freund
Date:
Subject: Re: Use -fvisibility=hidden for shared libraries