| From: | Lukas Fittl <lukas(at)fittl(dot)com> |
|---|---|
| To: | Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> |
| Cc: | Andres Freund <andres(at)anarazel(dot)de>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>, Peter Smith <smithpb2250(at)gmail(dot)com> |
| Subject: | Re: Stack-based tracking of per-node WAL/buffer usage |
| Date: | 2026-04-07 00:39:15 |
| Message-ID: | CAP53PkzfeTzoC0WTL-ftVsn00ZV9wTe2_6g71txE5dN3Zq1y5g@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, Apr 6, 2026 at 3:46 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> I couldn't find any issues with v15, all comments are stylistic/minor,
> except maybe the first one.
Thanks for reviewing!
>
> + /* Abort handling: link in parent QueryInstrumentation's unfinalized list */
> + dlist_node unfinalized_entry;
>
> Is it okay to store a pointer in shared memory, even if it seems to be
> always NULL there?
Its not ideal, mainly because a caller might interpret it incorrectly,
but as long as we don't read from it, its safe in practice. In the
parallel instrumentation we just use the Instrumentation struct as a
way to transport data (with the 0006 patch applied), and we
copy/accumulate from it before it gets used elsewhere.
I've previously avoided putting the unfinalized_entry value in the
Instrumentation struct for that reason, but I don't think there is a
good way to avoid that without complicating the design.
>
> #ifndef INSTRUMENT_NODE_H
> #define INSTRUMENT_NODE_H
>
> +
> +#include "executor/tuptable.h"
> +#include "nodes/execnodes.h"
> +
>
> Is it okay to incude files in the middle of the file, is there a good
> reason why these can't be at the top of the file?
Yeah, those need to be on the top of the file, good catch.
>
> + * Recurse into children first (bottom-up accumulation), and accummulate
> + * to this nodes instrumentation as the parent context.
>
> Two typos (accumulate / this node's)
Good catch, agreed those are typos.
>
> #define RELEASE_PRIO_FILES 600
> #define RELEASE_PRIO_WAITEVENTSETS 700
> +#define RELEASE_PRIO_INSTRUMENTATION 800
>
> This is mainly a generic observation, not strictly related to this
> patch, but this list could use some explanation which of these
> priorities are actually required by dependencies, and which are just
> "put the new entry at the end of the list".
Agreed, that would be helpful. It'll require more investigation to
confirm particular ordering reasons that exist today, but it seems
worth explaining more clearly.
I'll hold off on posting another patch round since what you raised
were just small stylistic issues, and they don't apply to the
remaining prep patches before the stack patch itself.
Thanks,
Lukas
--
Lukas Fittl
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2026-04-07 00:40:00 | Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc? |
| Previous Message | Peter Smith | 2026-04-07 00:25:05 | Re: DOC: pg_publication_rel.prrelid says sequences are possible |