From: | Thomas Munro <tmunro(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix latch event policy that hid socket events. |
Date: | 2025-01-20 04:01:13 |
Message-ID: | E1tZiyP-002Ud3-9z@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix latch event policy that hid socket events.
If a WaitEventSetWait() caller asks for multiple events, an already set
latch would previously prevent other events from being reported at the
same time. Now, we'll also poll the kernel for other events that would
fit in the caller's output buffer with a zero wait time. This policy
change doesn't affect callers that ask for only one event.
The main caller affected is the postmaster. If its latch is set
extremely frequently by backends launching workers and workers exiting,
we don't want it to handle only those jobs and ignore incoming client
connections.
Back-patch to 16 where the postmaster began using the API. The
fast-return policy changed here is older than that, but doesn't cause
any known problems in earlier releases.
Reported-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Reviewed-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Discussion: https://postgr.es/m/Z1n5UpAiGDmFcMmd%40nathan
Branch
------
REL_16_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/b4b52c911aafe482f008142d751b9ede6f85f52e
Modified Files
--------------
src/backend/storage/ipc/latch.c | 35 +++++++++++++++++++++--------------
1 file changed, 21 insertions(+), 14 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2025-01-20 10:22:43 | pgsql: Add const qualifiers to bufpage.h |
Previous Message | Thomas Munro | 2025-01-20 04:00:47 | pgsql: Fix latch event policy that hid socket events. |