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 1vSqDI-006cKW-0c for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 05:24:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSqDG-002xZR-2V for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 05:24:39 +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.96) (envelope-from ) id 1vSqDG-002xZJ-1Y for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 05:24:38 +0000 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vSqDD-003sIS-2t for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 05:24:37 +0000 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-7baf61be569so5709041b3a.3 for ; Mon, 08 Dec 2025 21:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765257876; x=1765862676; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KNdJ8sdxV2FYkQ8Tp/fIg3exKs1Tm1L9Ifk1ypQumek=; b=C6JlR6nnHcp9IeRhY+0k78AI7TjaWBDp5RWmEnBL1Xt+LSNMVt6wWeLc/eq13MJ3M1 Z8hUYg8MF1dVgpgND5wVW2NcWDMeDekCG5mQ9A33WH0eijDR7CCBRb0Nn2AoL+GmAF1F ak3A69EqPp0S6vuf7T2uLu/CKFK6UxBziRdJCkHGcIg9FRGGAVZn4YGVC83tkT85wAhk sHDkEEcLwNY0cnL/6LlNc723Mxub9O1Z1JqSmFq9YCqlmFgoG2iL0R7GbFVnzqJbKOEz Cv+xIONXFPSMUK/KSpr9aH5OOyipcysjFrom+wIHwX2dAQPaWow0dFKJHzo15ONi4U01 H9jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765257876; x=1765862676; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KNdJ8sdxV2FYkQ8Tp/fIg3exKs1Tm1L9Ifk1ypQumek=; b=ftJ0Y3Lab83/kncMTkunrgkWAXmqCLBYaaGbsUqp4VM6zvj1qm/lZsrvwqOnBhOVjX fvr0DRYS+JVdk+2VWSBIgEIhvqKVMUl4EQoztol6rn3YXOH1485UmLHnSG08hGTTBYTU aRsoxfAXhuhg191/2CYQ124psG0uEt2TDjL6G15Oea15SgsrjDnYvTvyUabQMcN2fCU1 whfag762P1fCuyQnPcZfzNnC0PuBhWEj1zXJjgrjJQ1nVcaPvjFI9/xP0T063yk1Gi1s w0xDL6e3pemAbcywt+fSatI9tDlDUU8SnhCicOGJhexj/Lrl4pcjbTXkW3wAvj3bfdpD hGWA== X-Forwarded-Encrypted: i=1; AJvYcCUFMSly5Vs8lshNllaF64ruA9DbWdRF/44hXvlzcFVjwzmWbFOuQDLbindHN/DzhePrJAJU4HEID/eTMfKr@lists.postgresql.org X-Gm-Message-State: AOJu0YwftoGLVhvvbgBF+8Q1Td7VZVii+OWUjwaDNRIPGLMYV/s8mRG/ TYB+mAFyZZJyRMNYGw3Yt/2Qmyy8SFLrivHt8DY6bSJrFcOatoHmSkEN X-Gm-Gg: ASbGncsL/scXOWbGs8XRI/c2Jyjg8gCpW1yNSc+h7DRwK9rCJlRwwZS9FfheyX5EZYo /nYfPue9L0X1PjkB+fTGDV4u5WcmzKg54DbB/60SzAHmJ8VMjdU+2+G7bi00OqBmxqT6ZL4tpqk O8bclGdRJT+TwUeeL55r/rJakKbfd2JmHGg8cZi8BgycZUpIPBypAu3aB5zA8xZ9rlZBzLdeBQ6 +sMm9HiPhykQVqX1ilAyvp9RymCJKDAUl6kw8xq+hL/fsCyoRapC5+Fdi02eF6iSyMo2sMmuQRQ 52HuyPucqA0af3Xobi7n2UsUVYt4vs+QC88G/ceHF5LG5xaK8uZzGyM+qjpPdhjlUpmOI5GKAK4 4Y7WkD0OGyfvGdfAZYnFvx45BILpRj73Kqb869VK4DYVZ2R+r6kamT7N3y1rJEV5G+hfm2j88KJ FKNwrK+4VmTgUyCDiZaAM= X-Google-Smtp-Source: AGHT+IEvcHwYpOQqwiMcCRy+nEsfRZf+52sJ0QHXFvru7CyVOfXJaofV1e1A03hlflUb7MNbqppDaw== X-Received: by 2002:a05:6a20:a10e:b0:364:133a:3594 with SMTP id adf61e73a8af0-36617e37d9amr9535463637.2.1765257875815; Mon, 08 Dec 2025 21:24:35 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29dae49caafsm143273965ad.11.2025.12.08.21.24.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Dec 2025 21:24:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [Proposal] Adding callback support for custom statistics kinds From: Chao Li In-Reply-To: Date: Tue, 9 Dec 2025 13:23:56 +0800 Cc: Sami Imseih , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <4FEEC2B8-D9CF-4BD0-AA7E-44CE3E27ADD8@gmail.com> <5EC13E39-B41E-464A-B382-0ACEB18A15BB@gmail.com> To: Michael Paquier X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 9, 2025, at 12:45, Michael Paquier wrote: >=20 > It seems to me that you are missing nothing here, and that Chao has > missed the fact that the end of pgstat_read_statsfile() does a "goto > done", meaning that we would take a round of No, I didn=E2=80=99t miss that part. But in the =E2=80=9Cdone=E2=80=9D = clause: ``` done: /* First, cleanup the main stats file, PGSTAT_STAT_PERMANENT_FILENAME */ FreeFile(fpin); elog(DEBUG2, "removing permanent stats file \"%s\"", statfile); unlink(statfile); /* Let each stats kind run its cleanup callback, if it provides one */ for (PgStat_Kind kind =3D PGSTAT_KIND_MIN; kind <=3D PGSTAT_KIND_MAX; = kind++) { const PgStat_KindInfo *kind_info =3D pgstat_get_kind_info(kind); if (kind_info && kind_info->end_extra_stats) kind_info->end_extra_stats(STATS_READ); } ``` end_extra_stats(STATS_READ) has no failure indication. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/