Re: Use WaitLatch for {pre, post}_auth_delay instead of pg_usleep

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use WaitLatch for {pre, post}_auth_delay instead of pg_usleep
Date: 2021-07-27 05:34:09
Message-ID: CALj2ACVxqfLoabFG5_gPYaS=ibZC2qSPTintazYP8yn40psaSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 26, 2021 at 11:03 PM Bossart, Nathan <bossartn(at)amazon(dot)com> wrote:
> > For PreAuthDelay, with the comment I wanted to say that the MyLatch is
> > not the correct one we would want to wait for. Since there is no
> > problem in using it there, I changed the comment to following:
> > /*
> > * Let's not use WL_LATCH_SET for PreAuthDelay to be consistent with
> > * PostAuthDelay.
> > */
>
> How about we elaborate a bit?
>
> WL_LATCH_SET is not used for consistency with PostAuthDelay.
> MyLatch isn't fully initialized for the backend at this point,
> anyway.

+1.

> + /*
> + * PostAuthDelay will not get applied, if WL_LATCH_SET is used. This
> + * is because the latch could have been set initially.
> + */
>
> I would suggest the following:
>
> If WL_LATCH_SET is used, PostAuthDelay may not be applied,
> since the latch might already be set.

+1.

> Otherwise, this patch looks good and could probably be marked ready-
> for-committer.

PSA v3 patch.

Regards,
Bharath Rupireddy.

Attachment Content-Type Size
v3-0001-Use-a-WaitLatch-for-pre-post-_auth_delay.patch application/octet-stream 7.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey V. Lepikhov 2021-07-27 05:34:30 Re: Removing unneeded self joins
Previous Message Ronan Dunklau 2021-07-27 05:20:17 Re: ORDER BY pushdowns seem broken in postgres_fdw