From: Andres Freund <andres@anarazel.de>
To: Amit Kapila <amit.kapila16@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Date: Fri, 13 Aug 2021 08:59:40 -0700
Message-ID: <20210813155940.kp7mdg3ynl2hodqk@alap3.anarazel.de> (raw)
In-Reply-To: <CAA4eK1Khx7nvqSS-inKB0WGbYxX1sy6EkzzxR-QmnVmFqnmmXw@mail.gmail.com>
References: <20210808022435.svp4spxlrfoi3w4p@alap3.anarazel.de>
<CAD21AoCCAa+J1-udHRo5-Hbtv=D38WdZDAaXZGDbQQ_Vg_d3bQ@mail.gmail.com>
<CAA4eK1LYw4J+BmYza+1VWF3QGo5NaV7goXFJ8g5gfA3WZRo6Xw@mail.gmail.com>
<CAD21AoAjrg5EuWM9qNApKRLC2LP+G18=u8xE=qbm2smmMzGC-A@mail.gmail.com>
<CAFiTN-uzNeU+cO-JZW6WCNAXu0qZgOoqzGrsP8y+k2BKu4SHdQ@mail.gmail.com>
<CAA4eK1JHUoE997NdUXbS9ikHk1oOtPupnNpGGnN_P3pn+jb6LQ@mail.gmail.com>
<20210812082237.in7l5x3rc4gxhgjh@alap3.anarazel.de>
<CAA4eK1L=fepiRg8PCx7_0z2Xgcu3bohzs=zMS6qutq0oD07wSQ@mail.gmail.com>
<20210812124819.5mrurb6ueizmqgru@alap3.anarazel.de>
<CAA4eK1Khx7nvqSS-inKB0WGbYxX1sy6EkzzxR-QmnVmFqnmmXw@mail.gmail.com>
Hi,
(dropping -committers to avoid moderation stalls due xposting to multiple lists -
I find that more annoying than helpful)
On 2021-08-13 14:38:37 +0530, Amit Kapila wrote:
> > What I'm wondering is why it is a good idea to have a SharedFileSet specific
> > cleanup mechanism. One that only operates on process lifetime level, rather
> > than something more granular. I get that the of the files here needs to be
> > longer than a transaction, but that can easily be addressed by having a longer
> > lived resource owner.
> >
> > Process lifetime may work well for the current worker.c, but even there it
> > doesn't seem optimal. One e.g. could easily imagine that we'd want to handle
> > connection errors or configuration changes without restarting the worker, in
> > which case process lifetime obviously isn't a good idea anymore.
> >
>
> I don't deny that we can't make this at a more granular level. IIRC,
> at that time, we tried to follow AtProcExit_Files which cleans up temp
> files at proc exit and we needed something similar for temporary files
> used via SharedFileSet.
The comparison to AtProcExit_Files isn't convincing to me - normally temp
files are cleaned up long before that via resowner cleanup.
To me the reuse of SharedFileSet for worker.c as executed seems like a bad
design. As things stand there's little code shared between dsm/non-dsm shared
file sets. The cleanup semantics are entirely different. Several functions
don't work if used on the "wrong kind" of set (e.g. SharedFileSetAttach()).
> I think we can extend this API but I guess it is better to then do it
> for dsm-based as well so that these get tracked via resowner.
DSM segments are resowner managed already, so it's not obvious that that'd buy
us much? Although I guess there could be a few edge cases that'd look cleaner,
because we could reliably trigger cleanup in the leader instead of relying on
dsm detach hooks + refcounts to manage when a set is physically deleted?
Greetings,
Andres Freund
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-committers@postgresql.org
Cc: andres@anarazel.de, amit.kapila16@gmail.com, thomas.munro@gmail.com, pgsql-hackers@postgresql.org, dilipbalaut@gmail.com, sawada.mshk@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
In-Reply-To: <20210813155940.kp7mdg3ynl2hodqk@alap3.anarazel.de>
References: <20210808022435.svp4spxlrfoi3w4p@alap3.anarazel.de> <CAD21AoCCAa+J1-udHRo5-Hbtv=D38WdZDAaXZGDbQQ_Vg_d3bQ@mail.gmail.com> <CAA4eK1LYw4J+BmYza+1VWF3QGo5NaV7goXFJ8g5gfA3WZRo6Xw@mail.gmail.com> <CAD21AoAjrg5EuWM9qNApKRLC2LP+G18=u8xE=qbm2smmMzGC-A@mail.gmail.com> <CAFiTN-uzNeU+cO-JZW6WCNAXu0qZgOoqzGrsP8y+k2BKu4SHdQ@mail.gmail.com> <CAA4eK1JHUoE997NdUXbS9ikHk1oOtPupnNpGGnN_P3pn+jb6LQ@mail.gmail.com> <20210812082237.in7l5x3rc4gxhgjh@alap3.anarazel.de> <CAA4eK1L=fepiRg8PCx7_0z2Xgcu3bohzs=zMS6qutq0oD07wSQ@mail.gmail.com> <20210812124819.5mrurb6ueizmqgru@alap3.anarazel.de> <CAA4eK1Khx7nvqSS-inKB0WGbYxX1sy6EkzzxR-QmnVmFqnmmXw@mail.gmail.com> <20210813155940.kp7mdg3ynl2hodqk@alap3.anarazel.de>
* 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