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 1qZ0Rt-003Xzk-Ct for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Aug 2023 02:51:53 +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 1qZ0Rs-003Ksa-7G for pgsql-hackers@arkaria.postgresql.org; Thu, 24 Aug 2023 02:51:51 +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 1qZ0Rr-003Ks4-T9 for pgsql-hackers@lists.postgresql.org; Thu, 24 Aug 2023 02:51:51 +0000 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qZ0Rk-000dTY-Ef for pgsql-hackers@postgresql.org; Thu, 24 Aug 2023 02:51:50 +0000 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-58df8cab1f2so66075457b3.3 for ; Wed, 23 Aug 2023 19:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692845504; x=1693450304; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GCNpznDEa0339dZ2La93t/Mm7OwOyTYjghT7zRMz46w=; b=PrRAaspD55H9RKrzi+hrMsYk6qdSEiJHYlNh8/In/oHSi22EP40PXGOOTB/6xxyNjW tINDcqj41z9bels3q8/+e/M029iUc3YucAKfP0i5NyxU3HkqXcgqOpBLH0n0XZYZnEuZ G5cAuJlGQGePE0CJSTi6/GxsEsclM7G1BRuiaTXpkYGnaC8FQ2Ed9OyJ10QAM9OiTSSA qvQWZViy9EAh+uzQQxXcMq+IIUGZ4WSQucZkzaRWMF1gjdqKFAUVJp0nNqwcM0iSIoTj 3uaLMMZT07Ds9+FKWcNQMkAGh+UcGmrCClSh+aGTmejk4LRRaBWh6p9ymHyWommyBoxD Ujww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692845504; x=1693450304; h=in-reply-to: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=GCNpznDEa0339dZ2La93t/Mm7OwOyTYjghT7zRMz46w=; b=e76QyMkT4vCIlWyvFMMuj9TgiFnwdAJ8WmovPXHqott6KrG9wbpu3j+dffk/soZoNA Rbq0mn17+tHfXTr5KJ+32F4VsD9cM0hqHJZNV3Pl/Q5wHu31motK8hpf8K9pLEzwrXCQ KgbzY+JtHAk5Ci4IayrPN7tFNE1IM9cOnsl/SZE3XPMPUnt+poDo2X+h0rL3hiqLrOPC WX82OSsnjleBRoCbjN/n6nJEGMgZHTYtjeQbDWaIlIPsaOUqL1jmgwEVfPlbJJ/s31NW klhVPI1pvI8UVqhhPAay7o6ffE7a0PVEtEVUM+jg3erOdrCbHD94qwJqVDUL77P6HFqw q+Yg== X-Gm-Message-State: AOJu0YwdMis4BPfKoSyR0/KkAsCb0KF90ErWD1PXmxrgrmW7jrmnZOKf nU61sNQ6X76QcJhBhgsr2CooRofmU0I= X-Google-Smtp-Source: AGHT+IFpyhhquvyrIMMFoB86xz2rsi3msRnV7pozkbnrOba9sU3X3ZS0yjbb5hJtJ71bcv0cCAOrPg== X-Received: by 2002:a81:4e87:0:b0:573:527b:747b with SMTP id c129-20020a814e87000000b00573527b747bmr14459869ywb.36.1692845503752; Wed, 23 Aug 2023 19:51:43 -0700 (PDT) Received: from nathanxps13.lan ([2600:6c42:7af0:90e0:b566:b514:3899:b807]) by smtp.gmail.com with ESMTPSA id q83-20020a815c56000000b005869d49212fsm3745953ywb.32.2023.08.23.19.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 19:51:43 -0700 (PDT) Date: Wed, 23 Aug 2023 19:51:40 -0700 From: Nathan Bossart To: Ian Lawrence Barwick Cc: pgsql-hackers , robertmhaas@gmail.com Subject: Re: pg_stat_get_backend_subxact() and backend IDs? Message-ID: <20230824025140.GB1128857@nathanxps13.lan> References: <20230824023206.GA1128857@nathanxps13.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230824023206.GA1128857@nathanxps13.lan> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Aug 23, 2023 at 07:32:06PM -0700, Nathan Bossart wrote: > On Thu, Aug 24, 2023 at 10:22:49AM +0900, Ian Lawrence Barwick wrote: >> Looking at the code, this is happening because >> "pgstat_fetch_stat_local_beentry()" >> expects to be passed the backend ID as an integer representing a 1-based index >> referring to "localBackendStatusTable", but "pg_stat_get_backend_subxact()" >> is presumably intended to take the actual BackendId , as per other >> "pg_stat_get_XXX()" >> functions. > > Yes, this was changed in d7e39d7, but 10ea0f9 seems to have missed the > memo. BTW I'd argue that this is a bug in v16 that we should try to fix before GA, so I've added an open item [0]. I assigned it to Robert (CC'd) since he was the committer, but I'm happy to pick it up. [0] https://wiki.postgresql.org/wiki/PostgreSQL_16_Open_Items#Open_Issues -- Nathan Bossart Amazon Web Services: https://aws.amazon.com