Re: Suppressing useless wakeups in walreceiver

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, alvherre(at)alvh(dot)no-ip(dot)org, bharath(dot)rupireddyforpostgres(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Suppressing useless wakeups in walreceiver
Date: 2022-11-14 20:42:26
Message-ID: CA+hUKG+j=WDMmGZ3ANBvvRhtjOgHGhq475fAB2Qqmz14WO0f2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 15, 2022 at 8:01 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
> Is there any reason we should wait for 100ms before sending the initial
> reply? ISTM the previous behavior essentially caused the first reply (and
> feedback message) to be sent at the first opportunity after streaming
> begins. My instinct is to do something like the attached. I wonder if we
> ought to do something similar in the ConfigReloadPending path in case
> hot_standby_feedback is being turned on.

That works for 020_pg_receivewal. I wonder if there are also tests
that stream a bit of WAL first and then do wait_for_catchup that were
previously benefiting from the 100ms-after-startup message by
scheduling luck (as in, that was usually enough for replay)? I might
go and teach Cluster.pm to log how much time is wasted in
wait_for_catchup to get some observability, and then try to figure out
how to optimise it properly. We could perhaps put the 100ms duct tape
back temporarily though, if necessary.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-11-14 20:58:06 Re: HOT chain validation in verify_heapam()
Previous Message Ankit Kumar Pandey 2022-11-14 20:16:00 Change error to warning and increase thresholds of tsearch