On Mon, Feb 10, 2025 at 8:23 AM Jacob Champion
<jacob.champ...@enterprisedb.com> wrote:
> The test is supposed to enforce that, but I see that it's not for some
> reason. That's concerning. I'll investigate, thanks for pointing it
> out.

Bad regex escaping on my part; fixed in v8. Thanks for the report!

While debugging, I also noticed that a poorly timed autovacuum could
also show up in my new pg_stat_activity query, so I've increased the
specificity.

> Do we _want_ nine separate flavors of WAIT_EVENT_LDAP_UNBIND? I
> figured it was enough to know that you were stuck unbinding.

v8-0003 shows this approach. For the record, I think it's materially
worse than v7-0003. IMO it increases the cognitive load for very
little benefit and makes it more work for a newcomer to refactor the
cleanup code for those routines. I think it's enough that you can see
a separate LOG message for each failure case, if you want to know why
we're unbinding.

Thanks,
--Jacob
1:  b91a602cab8 ! 1:  81a61854bdf pgstat: report in earlier with STATE_STARTING
    @@ src/backend/utils/activity/backend_status.c: pgstat_bestart(void)
     +
     +  PGSTAT_END_WRITE_ACTIVITY(beentry);
      
    +   /* Create the backend statistics entry */
    +   if (pgstat_tracks_backend_bktype(MyBackendType))
    +           pgstat_create_backend(MyProcNumber);
    + 
        /* Update app name to current GUC setting */
     +  /* TODO: ask the list: maybe do this before setting STATE_UNDEFINED? */
        if (application_name)
    @@ src/test/authentication/meson.build: tests += {
      ## src/test/authentication/t/007_pre_auth.pl (new) ##
     @@
     +
    -+# Copyright (c) 2021-2024, PostgreSQL Global Development Group
    ++# Copyright (c) 2021-2025, PostgreSQL Global Development Group
     +
     +# Tests for connection behavior prior to authentication.
     +
    @@ src/test/ssl/t/001_ssltests.pl: command_like(
     +  while (1)
     +  {
     +          $pid = $psql->query(
    -+                  "SELECT pid FROM pg_stat_activity WHERE state = 
'starting';");
    ++                  "SELECT pid FROM pg_stat_activity WHERE state = 
'starting' AND client_addr IS NOT NULL;");
     +          last if $pid ne "";
     +
     +          usleep(100_000);
    @@ src/test/ssl/t/001_ssltests.pl: command_like(
     +          $psql->query(
     +                  "SELECT ssl, version, cipher, bits FROM pg_stat_ssl 
WHERE pid = $pid"
     +          ),
    -+          qr/^t|TLSv[\d.]+|[\w-]+|\d+$/,
    ++          qr/^t\|TLSv[\d.]+\|[\w-]+\|\d+$/,
     +          'pg_stat_ssl view is updated prior to authentication');
     +
     +  # Detach the waitpoint and wait for the connection to complete.
2:  0cb5ab8b89d = 2:  e734e46009f Report external auth calls as wait events
3:  a0308928dd3 < -:  ----------- squash! Report external auth calls as wait 
events
-:  ----------- > 3:  39c7d9ce42b squash! Report external auth calls as wait 
events

Attachment: v8-0001-pgstat-report-in-earlier-with-STATE_STARTING.patch
Description: Binary data

Attachment: v8-0002-Report-external-auth-calls-as-wait-events.patch
Description: Binary data

Attachment: v8-0003-squash-Report-external-auth-calls-as-wait-events.patch
Description: Binary data

Reply via email to