Re: Enhancing Memory Context Statistics Reporting
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Rahila Syed <rahilasyed90@gmail.com>
Cc: Daniel Gustafsson <daniel@yesql.se>,
torikoshia <torikoshia@oss.nttdata.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2026-01-19T18:02:27Z
Lists: pgsql-hackers
On Mon, Jan 19, 2026 at 12:31 PM Rahila Syed <rahilasyed90@gmail.com> wrote: > Starting a transaction from CFI works for a client backend but > not for auxiliary processes. When I try to execute StartTransaction() > from a checkpointer process, the following assertion fails, > Assert(MyProc->vxid.procNumber == vxid.procNumber); > This is because MyProc->vxid.procNumber is not set for auxiliary > processes. Unfortunately, somebody is going to need to think through - and perhaps test - what happens in each individual type of background process -- not just auxiliary processes but also background workers, including but not limited to parallel workers. Some of them have error recovery logic that is similar to transaction cleanup but only covers a subset of things, in which case the question will be whether that logic handles all the kinds of resources that this code might acquire. Some of them may just straight up kill the process if an error occurs, which is fine for this patch as long as it only happens in extreme situations (e.g. OOM). In other words, we don't necessarily need a transaction specifically, but we need whatever form of error recovery is in use in any given process to be appropriate to the code that this patch proposes to execute. For a regular backend, that's a transaction. Also worth noting: I don't think that all backend types actually use CHECK_FOR_INTERRUPTS(). For those that don't, other updates may be needed to make this feature work. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Cross-check lists of built-in LWLock tranches.
- 2047ad068139 19 (unreleased) cited
-
Convert strncpy to strlcpy
- 45e7e8ca9e93 18.0 landed
-
Typo and doc fixups for memory context reporting
- f8c115a6cb65 18.0 landed
-
Add missing string terminator
- d2a1ed1727a8 18.0 landed
-
Rename argument in pg_get_process_memory_contexts().
- c57971034e69 18.0 landed
-
Add function to get memory context stats for processes
- 042a66291b04 18.0 landed