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.96) (envelope-from ) id 1wWVaH-002fEO-09 for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Jun 2026 08:43:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wWVaF-001RF6-2J for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Jun 2026 08:43:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wWVaF-001REx-1W for pgsql-bugs@lists.postgresql.org; Mon, 08 Jun 2026 08:43:47 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wWVaD-00000001vGS-1IDT for pgsql-bugs@lists.postgresql.org; Mon, 08 Jun 2026 08:43:46 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-bec49f7e35eso529101666b.2 for ; Mon, 08 Jun 2026 01:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780908224; cv=none; d=google.com; s=arc-20240605; b=c/jW9R1aNwOizdq7he+O79jjOxpakVSKtduPIbAgCCqXvphCoX/8dlzycPscxtljCM y2fdOlD43o+9cV659iJA/0eHfp3DKh4ea/487053IToxa5B5vuAzyoESTCmkiIBgIXWG 9L5Pl2KvRQc04s/0j+lPIUswlPyvO3EAANvc3KouyftZMJbJcV4fGPF9vr6fPjFuI+FI tRfVwn7qMU6N90J1PZbSq72XMRMXD/mtAvI8yzF7eKGys63SUdcoKwDME3cUbP6xs3Fv fytG4XzPDvLOnDvDlCvbB+7upyTPwnjhR+1QAXG40kNdjuWLULcHiYbSWkSD+Kxso6f1 6+Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=MqAI5pCo3huxunBOFhJEIu1MxDMpr0Lt1Q5/seEY6F8=; fh=zGr14wsSTG/kqhnHoolcGLFbYPyilp92LpSMqrXtvx8=; b=FIPGPhGNfLR86pVuvWdMD7VL8czLqvx4A/F7dxIFqTtxAgh9aN5VuKNjWf8j+8CIve dhCmATBrDUcAHNammhFJdyR1NCKEej10DCTpwkKANBxTUzucdCxmU353yarsr39HBQjU XOIx5NyCkGLwTDG2b8eBcc8pqjrcC39NQNiq/cyPDxKqEgBDzum7yZxqZAAiO7VbVLX8 rCaIwL957iMgDBiHviwj37UlCWWBgm62OUMl1ZErnbNwSv3qT+gUYWHABYRbAUuqL1M3 nObeUDHMb+KChJ3TPnkmEXM2q0FJ8ZURrKbWvWPoAr/I16+++ITdsEVEJOhYEgOP941m WgqQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780908224; x=1781513024; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MqAI5pCo3huxunBOFhJEIu1MxDMpr0Lt1Q5/seEY6F8=; b=jvJsgTrZjJn3UD4K1t83OfXQ9XkwgeEbEUm8XFOOexzP5kieTJh4xdwZSA0CSZVzrl /aCwcwcZDZnnUOY0TAnqH+VAXs0FpRPf1rXM+AhAa2C7MkvkxBvv8ppVFuiqy55eiPuR sCvBZFlDAT2pW76e2zY9CD3mkDG797O/dAzI3NUoYVqHI+LB0KB6+7e9AjEZa1MLJcsQ 53SqTjR5YO2iX8xCy83lsznep9ycUC88HOtWKpRB/7bLZpnIliG0QSw93tmd77Jtro4V JJBxC5OPlOmc9t8Y0vmFBM3KJoY4IuVrD7WK6HZkonfaRfdFkRPu02CrFFLT2I+vEKwJ Vqhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780908224; x=1781513024; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MqAI5pCo3huxunBOFhJEIu1MxDMpr0Lt1Q5/seEY6F8=; b=U08I/h+AETtafo0oPdnS1Jln4CFpjQDgrZnSOsd32vG9Mgpib3Ln7C3fzMyjXXC5IP BZhzqOxRAKs2SdSv2xzDEU5GsfSzdWvjeaLr8EybGB14S7lGYzhJzkJ66CBq+SbKrWTG dB53bgO4+YajUsOlbLwljVx5s6CxZYEILvCn9gUw3FCJOyH0RHg4dAIEPFfXGf8Y74WL 9E/q9RR+8jN7pqZeBFj43PkdTE0pfWNlVZfZT2kO7+lUgEfYpzGMv5GQsg5Qod523542 AIUm2elejlozOVdF25cfncUqen4jq2AEEE+lHmXnLhN1bmDA8q7RasxCwLscDFYbMHQb aQdw== X-Forwarded-Encrypted: i=1; AFNElJ8z5JMu3wf0J+T6qQYzPNbGU1WMxTeHwGTKrs9JHRBr+uU6L7YUyVLmaDaRohsVVaJVoCNDyvuEbGiX@lists.postgresql.org X-Gm-Message-State: AOJu0YziWHBpMsF7kWNgMOK/3XtriQZCPl/p6efuftRyvyxp7wTFewwg ShnK0weA3nw2dJfGjxU/q8OTe5XDXEBIDpfFG0FhFQSi4W4tOV7n4jf1Uu9HRF4Vrdh1fcCy4cp BS2mlY4RNBI82d08a5M55dVydCiF29yA= X-Gm-Gg: Acq92OH7LI0XdawRO2KQhZA1a3a61AU/B5yVDNMY/LSISBGcTEknOLnmZ4cRnlGGnRv HJkJtKTDJTgJrpBJpQVwDIDtWUzwD5431wy2xkktAOtwZXPbIpZXhGfhZeUmCD7Z+R/L/9iXDjU +s1KTmMnqGG9fi0dkWe15k0uLHFRkvYb3ADpkJ7/cf2EP+wJADfuRuzpuFw6nhgyoUu2o8CWZ0l /mPMb+79yGNlaDfItVXxecueLnlPd4UejR9WoJICCNJOhxDlpdkB2Co0I+2NZgbB+2BTBmWch7i zyGv+oyzL0/aq3vIB9TDgwctXUcvQ6qT7zyi0qL06/0/VzN79sfQPSo1g5bz7XWxNxK+JVGggya R2+B2b2u65DjT2MLW62KBRDVW/2iFGQt3vlvNuVTMQIogSTWOtdU= X-Received: by 2002:a17:906:f5a2:b0:bd3:2b8a:2164 with SMTP id a640c23a62f3a-bf370a66df8mr689214366b.16.1780908223486; Mon, 08 Jun 2026 01:43:43 -0700 (PDT) MIME-Version: 1.0 References: <18158-88f667028dbc7e7b@postgresql.org> <58b5d6bf-7dca-41e5-8000-e12981205ada@gmail.com> <5edd4f4a-0d79-465d-a250-8b4735f780ca@gmail.com> In-Reply-To: From: Xuneng Zhou Date: Mon, 8 Jun 2026 16:43:31 +0800 X-Gm-Features: AVVi8Ccuabp8VAE1_5-z6RB5ZrIamf5v0B0aoOpsCsYWSw3CiEHoVDm9496AxSg Message-ID: Subject: Re: BUG #18158: Assert in pgstat_report_stat() fails when a backend shutting down with stats pending To: Michael Paquier Cc: Alexander Lakhin , pgsql-bugs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jun 8, 2026 at 1:49=E2=80=AFPM Michael Paquier wrote: > > On Sat, Jun 06, 2026 at 08:45:26PM +0800, Xuneng Zhou wrote: > > Sorry for being late. One nit for the patch -- would it be better to > > use AmWalSenderProcess() for identification to save the include? > > +#include "replication/walsender.h" > > In the startup sequence, MyBackendType is updated to B_WAL_SENDER a > couple of lines after am_walsender. One or the other don't really > matter; they're both right. Yeah, both of them work well. To use AmWalSenderProcess(), we would need to include src/include/miscadmin.h, whereas using am_walsender requires including =E2=80=9Creplication/walsender.h=E2=80=9D. I=E2=80=99m j= ust wondering whether using AmWalSenderProcess() would result in less coupling between pgstat and replication. -- Regards, Xuneng Zhou HighGo Software Co., Ltd.