Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Jacob Champion <jacob.champion@enterprisedb.com>
Cc: Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>, Noah Misch <noah@leadboat.com>, Andrew Dunstan <andrew@dunslane.net>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Euler Taveira <euler.taveira@enterprisedb.com>, Daniel Gustafsson <daniel@yesql.se>
Date: 2025-03-05T04:45:12Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-race-condition-in-pre-auth-test.patch (text/x-diff) patch 0001
On Tue, Mar 04, 2025 at 04:53:14PM -0800, Jacob Champion wrote: > I'll work on a fix, but it probably won't be fast since I need to > learn more about the injection points architecture. The test may need > to be disabled, or the patch backed out, depending on how painful the > flake is for everybody. Oops, missed these failures.. So we have a race condition where we are trying to wake up a point that's not waiting yet, because there is a small window between the moment when the backend entry is marked as "starting" and the injection point wait. What this is telling us is that we should change the query scanning pg_stat_activity for a PID of a backend in 'starting' state so as we also check the wait_event init-pre-auth, as this is reported when using injection point waits. The attached should be enough to take care of this race condition. -- Michael
Commits
-
Fix race condition in TAP test 007_pre_auth
- e2080261cc8c 18.0 landed
-
Split pgstat_bestart() into three different routines
- c76db55c9085 18.0 landed
-
backport: Extend background_psql() to be able to start asynchronously
- 6af51bf05a6a 13.21 landed
- 7c07ab62aeb7 14.18 landed
- c0bc11aebb01 15.13 landed
- 6ab58d506bba 16.9 landed
- 49b6f4a02b23 17.5 landed
-
backport: Improve handling of empty query results in BackgroundPsql
- 3c562b58c20e 13.21 landed
- 3170aece14b8 14.18 landed
- f4b08ccb4ec8 15.13 landed
- fbfd38662f72 16.9 landed
- 31a242e90c88 17.5 landed
-
Improve handling of empty query results in BackgroundPsql::query()
- 70291a3c66ec 18.0 landed
-
Extend Cluster.pm's background_psql() to be able to start asynchronously
- ba08edb06545 18.0 landed
-
dblink: Replace WAIT_EVENT_EXTENSION with custom wait events
- c789f0f6cc5d 17.0 cited