Re: Enhancing Memory Context Statistics Reporting

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, Rahila Syed <rahilasyed90(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Enhancing Memory Context Statistics Reporting
Date: 2025-04-08 16:41:49
Message-ID: 3eb40b3e-45c7-426a-b7f8-81f7d05a9b53@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025/04/08 18:46, Daniel Gustafsson wrote:
>> On 8 Apr 2025, at 10:03, Daniel Gustafsson <daniel(at)yesql(dot)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

Attachment Content-Type Size
v1-0001-Rename-misleading-argument-in-pg_get_process_memo.patch text/plain 1.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2025-04-08 16:42:19 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Nico Williams 2025-04-08 16:39:22 Re: Feature freeze