From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Daniel Gustafsson <daniel@yesql.se>
To: Rahila Syed <rahilasyed90@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Enhancing Memory Context Statistics Reporting
Date: Wed, 9 Apr 2025 01:41:49 +0900
Message-ID: <3eb40b3e-45c7-426a-b7f8-81f7d05a9b53@oss.nttdata.com> (raw)
In-Reply-To: <B15D670F-D47B-40DF-A447-0773504B5217@yesql.se>
References: <CAExHW5skNvp265od6XPs0O-RL3cwtgHW3N87Ob0+nByZ=_HzAA@mail.gmail.com>
<CAH2L28sMyRh_ZomRxkx_RdaQoLcyGAwKCr1TSmrVudbbR_Q1eQ@mail.gmail.com>
<F23526FA-407E-484B-88BC-4CA81C7CED52@yesql.se>
<CAH2L28v9EU4dxKUpvMt_CFAzG72CYusPWxADsgT=cwFJP-fP0A@mail.gmail.com>
<D3689B96-DB1E-4160-AC5E-C2F4E2ACA8CD@yesql.se>
<54FAE93D-E156-4684-9352-1CEDE6BD4A1C@yesql.se>
<CAH2L28s+s4JJdPz2RkALzOvXpxXUcmm=fvg-Y6M82g9Cp=bB-w@mail.gmail.com>
<F50279EA-E138-4C93-BCF5-8B2FC338BFA1@yesql.se>
<5bxhxniyvjyfldi7yjxcnxkl3i2ghci2grjyeclrbkfqnyhowk@dfkqzbvtbpml>
<B5BF7FC9-D9AA-4C43-AC28-8A6599056CC0@yesql.se>
<tesneyk3z2dtrjgwlmkw2wbr7e3olwkowlpke6kl463hfhxedb@fyyqsnwjcp4l>
<CAH2L28tp8RMa0CrCgdCJw20vFzeGQMuHkXAoPgYC5JZuXY8_+g@mail.gmail.com>
<F12013F0-F54F-4C3D-92C5-76F8AE944CED@yesql.se>
<B15D670F-D47B-40DF-A447-0773504B5217@yesql.se>
On 2025/04/08 18:46, Daniel Gustafsson wrote:
>> On 8 Apr 2025, at 10:03, Daniel Gustafsson <daniel@yesql.se> wrote:
>
>> There was a bug in the shmem init function which caused it to fail on Windows,
>> the attached fixes that.
>
> With this building green in CI over several re-builds, and another pass over
> the docs and code with pgindent etc done, I pushed this earlier today. A few
> BF animals have built green so far but I will continue to monitor it.
Thanks for committing this feature!
I noticed that the third argument of pg_get_process_memory_contexts() is named
"retries" in pg_proc.dat, while the documentation refers to it as "timeout".
Since "retries" is misleading, how about renaming it to "timeout" in pg_proc.dat?
Patch attached.
Also, as I mentioned earlier, I encountered an issue when calling
pg_get_process_memory_contexts() on the PID of a backend that had just
encountered an error but hadn't finished rolling back. It led to
the following situation:
Session 1 (PID=70011):
=# begin;
=# select 1/0;
ERROR: division by zero
Session 2:
=# select * from pg_get_process_memory_contexts(70011, false, 10);
Session 1 terminated with:
ERROR: ResourceOwnerEnlarge called after release started
FATAL: terminating connection because protocol synchronization was lost
Shouldn't this be addressed?
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachments:v1-0001-Rename-misleading-argument-in-pg_get_process_memo.patch (text/plain, 1.6K) download
From a79084fe3caaf791f2aa8d466603c085ccb8c5af Mon Sep 17 00:00:00 2001
From: Fujii Masao <fujii@postgresql.org>
Date: Wed, 9 Apr 2025 01:27:48 +0900
Subject: [PATCH v1] Rename misleading argument in
pg_get_process_memory_contexts().
Previously, the third argument of pg_get_process_memory_contexts()
was named retries in pg_proc.dat, even though it actually specifies
a timeout value in seconds. This name was misleading to users and
inconsistent with the documentation, which correctly referred to it
as timeout.
This commit renames the argument to timeout in pg_proc.dat to
improve clarity and maintain consistency with the documentation.
---
src/include/catalog/pg_proc.dat | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.datindex 4708f55be18..62beb71da28 100644--- a/src/include/catalog/pg_proc.dat+++ b/src/include/catalog/pg_proc.dat@@ -8578,7 +8578,7 @@
prorettype => 'record', proargtypes => 'int4 bool float8',
proallargtypes => '{int4,bool,float8,text,text,text,_int4,int4,int8,int8,int8,int8,int8,int4,timestamptz}',
proargmodes => '{i,i,i,o,o,o,o,o,o,o,o,o,o,o,o}',
- proargnames => '{pid, summary, retries, name, ident, type, path, level, total_bytes, total_nblocks, free_bytes, free_chunks, used_bytes, num_agg_contexts, stats_timestamp}',+ proargnames => '{pid, summary, timeout, name, ident, type, path, level, total_bytes, total_nblocks, free_bytes, free_chunks, used_bytes, num_agg_contexts, stats_timestamp}',
prosrc => 'pg_get_process_memory_contexts' },
# non-persistent series generator
--
2.49.0
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, daniel@yesql.se, rahilasyed90@gmail.com, andres@anarazel.de
Subject: Re: Enhancing Memory Context Statistics Reporting
In-Reply-To: <3eb40b3e-45c7-426a-b7f8-81f7d05a9b53@oss.nttdata.com>
References: <CAExHW5skNvp265od6XPs0O-RL3cwtgHW3N87Ob0+nByZ=_HzAA@mail.gmail.com> <CAH2L28sMyRh_ZomRxkx_RdaQoLcyGAwKCr1TSmrVudbbR_Q1eQ@mail.gmail.com> <F23526FA-407E-484B-88BC-4CA81C7CED52@yesql.se> <CAH2L28v9EU4dxKUpvMt_CFAzG72CYusPWxADsgT=cwFJP-fP0A@mail.gmail.com> <D3689B96-DB1E-4160-AC5E-C2F4E2ACA8CD@yesql.se> <54FAE93D-E156-4684-9352-1CEDE6BD4A1C@yesql.se> <CAH2L28s+s4JJdPz2RkALzOvXpxXUcmm=fvg-Y6M82g9Cp=bB-w@mail.gmail.com> <F50279EA-E138-4C93-BCF5-8B2FC338BFA1@yesql.se> <5bxhxniyvjyfldi7yjxcnxkl3i2ghci2grjyeclrbkfqnyhowk@dfkqzbvtbpml> <B5BF7FC9-D9AA-4C43-AC28-8A6599056CC0@yesql.se> <tesneyk3z2dtrjgwlmkw2wbr7e3olwkowlpke6kl463hfhxedb@fyyqsnwjcp4l> <CAH2L28tp8RMa0CrCgdCJw20vFzeGQMuHkXAoPgYC5JZuXY8_+g@mail.gmail.com> <F12013F0-F54F-4C3D-92C5-76F8AE944CED@yesql.se> <B15D670F-D47B-40DF-A447-0773504B5217@yesql.se> <3eb40b3e-45c7-426a-b7f8-81f7d05a9b53@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox