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

From Nathan Bossart
Subject Re: Suppressing useless wakeups in walreceiver
Date
Msg-id 20220930035141.GA124911@nathanxps13
Whole thread Raw
In response to Re: Suppressing useless wakeups in walreceiver  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: Suppressing useless wakeups in walreceiver
List pgsql-hackers
I was surprised to see that this patch was never committed!

On Mon, Jan 31, 2022 at 04:28:11PM +0900, Kyotaro Horiguchi wrote:
> +static void
> +WalRcvComputeNextWakeup(WalRcvInfo *state,
> +                        WalRcvWakeupReason reason,
> +                        TimestampTz now)
> +{
> +    switch (reason)
> +    {
> ...
> +    default:
> +        break;
> +    }
> +}
> 
> Mmm.. there's NUM_WALRCV_WAKEUPS.. But I think we don't need to allow
> the case.  Isn't it better to replace the break with Assert()?

+1

> It might be suitable for another patch, but we can do that
> together. If we passed "now" to the function XLogWalRcvProcessMsg, we
> would be able to remove further several calls to
> GetCurrentTimestamp(), in the function itself and
> ProcessWalSndrMessage (the name is improperly abbreviated..).

While reading the patch, I did find myself wondering if there were some
additional opportunities for reducing the calls to GetCurrentTimestamp().
That was really the only thing that stood out to me.

Thomas, are you planning to continue with this patch?  If not, I don't mind
picking it up.

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



pgsql-hackers by date:

Previous
From: Wenchao Zhang
Date:
Subject: Re: Assign TupleTableSlot->tts_tableOid duplicated in tale AM.
Next
From: David Rowley
Date:
Subject: Re: disfavoring unparameterized nested loops