Re: sync request forward function ForwardSyncRequest() might hang for some time in a corner case? - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: sync request forward function ForwardSyncRequest() might hang for some time in a corner case?
Date
Msg-id CAOBaU_Y9miziVTYJJaBdYw=8sGN364psA-HS6NFuPi=tUvkYKg@mail.gmail.com
Whole thread Raw
In response to Re: sync request forward function ForwardSyncRequest() might hang for some time in a corner case?  (Paul Guo <paulguo@gmail.com>)
Responses Re: sync request forward function ForwardSyncRequest() might hang for some time in a corner case?
List pgsql-hackers
On Thu, May 27, 2021 at 10:05 PM Paul Guo <paulguo@gmail.com> wrote:
>
> Also note that ForwardSyncRequest() does wake up the checkpointer if
> it thinks the requests in shared memory are "too full", but does not
> wake up when the request is actually full. This does not seem to be reasonable.
> See below code in ForwardSyncRequest
>
>     /* If queue is more than half full, nudge the checkpointer to empty it */
>     too_full = (CheckpointerShmem->num_requests >=
>                 CheckpointerShmem->max_requests / 2);
>
>     /* ... but not till after we release the lock */
>     if (too_full && ProcGlobal->checkpointerLatch)
>         SetLatch(ProcGlobal->checkpointerLatch);

Ah indeed.  Well it means that the checkpointer it woken up early
enough to avoid reaching that point.  I'm not sure that it's actually
possible to reach a point where the list if full and the checkpointer
is sitting idle.



pgsql-hackers by date:

Previous
From: Paul Guo
Date:
Subject: Re: sync request forward function ForwardSyncRequest() might hang for some time in a corner case?
Next
From: Robert Haas
Date:
Subject: Re: Move pg_attribute.attcompression to earlier in struct for reduced size?