Re: Enhancing Memory Context Statistics Reporting - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Enhancing Memory Context Statistics Reporting
Date
Msg-id 2245A54A-C71D-47BE-88A6-EAD224116243@yesql.se
Whole thread Raw
In response to Re: Enhancing Memory Context Statistics Reporting  (Fujii Masao <masao.fujii@oss.nttdata.com>)
List pgsql-hackers
> On 8 Apr 2025, at 18:41, Fujii Masao <masao.fujii@oss.nttdata.com> wrote:
> 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.

Ugh, that's my bad.  It was changed from using retries to a timeout and I
missed that.

> 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?

Sorry, this must've been missed in this fairly lon thread, will have a look at
it tonight.

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Next
From: Robert Haas
Date:
Subject: Re: Feature freeze