Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1so7ww-008USj-Ig for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2024 20:58:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1so7wv-002JbB-J3 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2024 20:58:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1so7wv-002Jb1-23 for pgsql-hackers@lists.postgresql.org; Tue, 10 Sep 2024 20:58:57 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1so7wr-000WVy-N5 for pgsql-hackers@postgresql.org; Tue, 10 Sep 2024 20:58:55 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2059112f0a7so55631205ad.3 for ; Tue, 10 Sep 2024 13:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1726001933; x=1726606733; darn=postgresql.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ux9W9ZvVXkcW5FkuzRzXmA6a3x+kCziAHlHHTHJkkQI=; b=GNiqxiAU8xEHytt2NEAVgJPZz7oQJxIRDZ2/7AVGTdl2KkYFMrYolmbA21RJPEgz1J u+LcidmE/1s/qUfzGOBEnXG9MQlNdefA+z1ULKowcO9RBwGjNWDcvrSYaI07403XsN4X sZEd24iOnuIyLsJNreVqNInCoRnRZaSjp6D6s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726001933; x=1726606733; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ux9W9ZvVXkcW5FkuzRzXmA6a3x+kCziAHlHHTHJkkQI=; b=JbUkf87zo5EYnKGL1BKuXz27PcBQca+pn9HwF8s16owRodwSu1hmkh5qXbA+VKgjhs DawGxxCpRvIpycbaD26/G4iELfrLnqSUu2JqpR/7+RfRyZulLth1PMZwvGkUYBstwG2E LXSQig/JoAG8GlVSAZuZsozR1liHBlcENK7a9AODuoWmWsRZgXwvdCStbZ0lTJoYCHZw PQReiwcmddstbV7Tk6ugt72yuGwDH4IvUKFTGmeEWSfitOEdO3syIfgvfgBxfq5jLky2 NI2t62NsDFCwoXaZnZ2nmr0JI52IhhDvWc6AKfXFBphNkBap2GqwtpwVw3L7MyiknzVw KD+Q== X-Forwarded-Encrypted: i=1; AJvYcCW1Imn5qBmMl7By3L4npyrFAYSt0IaBOOKSXkf3/8a2POX/O0C8tzbMY4XT+y9AjS9xgAL4Oe/VrepU0hnf@postgresql.org X-Gm-Message-State: AOJu0YzxrXa9JF9aV0zi7UYmYurBldycKLrnR1BbQwjH2iU9eYmlj5mu DHJGT3YovSLbH+HmrwjP3JKQa18UXm/7EZ5/+eGpHyn53VJCJdNTDlDd116OOw== X-Google-Smtp-Source: AGHT+IEzWWR7DUBQk54m93RJHIbYrZv7iy8P5U6XCGUKXhHa51WeEyKSC++KrZ0BZUUt59l+NDldOA== X-Received: by 2002:a17:902:c943:b0:206:9ab3:2ec1 with SMTP id d9443c01a7336-2074c5da65amr27070075ad.22.1726001932606; Tue, 10 Sep 2024 13:58:52 -0700 (PDT) Received: from google.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710eea91asm52628375ad.171.2024.09.10.13.58.51 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Sep 2024 13:58:52 -0700 (PDT) Date: Tue, 10 Sep 2024 13:58:50 -0700 From: Noah Misch To: Robert Haas Cc: Michael Paquier , Jacob Champion , Andrew Dunstan , PostgreSQL Hackers , Euler Taveira Subject: Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible Message-ID: <20240910205850.5d.nmisch@google.com> References: <20240630174812.d1.nmisch@google.com> <34cc0828-d988-4503-9944-ea6288f0ca8a@dunslane.net> <20240910172712.e8.nmisch@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Sep 10, 2024 at 02:51:23PM -0400, Robert Haas wrote: > On Tue, Sep 10, 2024 at 1:27 PM Noah Misch wrote: > > On Tue, Sep 10, 2024 at 02:29:57PM +0900, Michael Paquier wrote: > > > You are adding twelve event points with only 5 > > > new wait names. Couldn't it be better to have a one-one mapping > > > instead, adding twelve entries in wait_event_names.txt? > > > > No, I think the patch's level of detail is better. One shouldn't expect the > > two ldap_simple_bind_s() calls to have different-enough performance > > characteristics to justify exposing that level of detail to the DBA. > > ldap_search_s() and InitializeLDAPConnection() differ more, but the DBA mostly > > just needs to know the scale of their LDAP responsiveness problem. > > > > (Someday, it might be good to expose the file:line and/or backtrace associated > > with a wait, like we do for ereport(). As a way to satisfy rare needs for > > more detail, I'd prefer that over giving every pgstat_report_wait_start() a > > different name.) > > I think unique names are a good idea. If a user doesn't care about the > difference between sdgjsA and sdjgsB, they can easily ignore the > trailing suffix, and IME, people typically do that without really > stopping to think about it. If on the other hand the two are lumped > together as sdjgs and a user needs to distinguish them, they can't. So > I see unique names as having much more upside than downside. I agree a person can ignore the distinction, but that requires the person to be consuming the raw event list. It's reasonable to tell your monitoring tool to give you the top N wait events. Individual AuthnLdap* events may all miss the cut even though their aggregate would have made the cut. Before you know to teach that monitoring tool to group AuthnLdap* together, it won't show you any of those names. I felt commit c789f0f also chose sub-optimally in this respect, particularly with the DblinkGetConnect/DblinkConnect pair. I didn't feel strongly enough to complain at the time, but a rule of "each wait event appears in one pgstat_report_wait_start()" would be a rule I don't want. One needs familiarity with the dblink implementation internals to grasp the DblinkGetConnect/DblinkConnect distinction, and a plausible refactor of dblink would make those names cease to fit. I see this level of fine-grained naming as making the event name a sort of stable proxy for FILE:LINE. I'd value exposing such a proxy, all else being equal, but I don't think wait event names like AuthLdapBindLdapbinddn/AuthLdapBindUser are the right way. Wait event names should be more independent of today's code-level details.