Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Date: 2021-08-16 14:47:47
Message-ID: CAFiTN-v7kyWA3EZ_btNqLrwFoD0xwuX8eZ3CNaupN-JJircLaQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Fri, Aug 13, 2021 at 9:29 PM Andres Freund <andres(at)anarazel(dot)de> wrote:

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

In an off-list discussion with Thomas and Amit, we tried to discuss
how to clean up the shared files set in the current use case. Thomas
suggested that instead of using individual shared fileset for storing
the data for each XID why don't we just create a single shared fileset
for complete worker lifetime and when the worker is exiting we can
just remove that shared fileset. And for storing XID data, we can
just create the files under the same shared fileset and delete those
files when we longer need them. I like this idea and it looks much
cleaner, after this, we can get rid of the special cleanup mechanism
using 'filesetlist'. I have attached a patch for the same.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-Better-usage-of-sharedfileset-in-apply-worker.patch application/octet-stream 20.0 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message John Naylor 2021-08-16 15:53:07 pgsql: Use direct function calls for pg_popcount{32,64} on non-x86 plat
Previous Message Daniel Gustafsson 2021-08-16 11:41:07 pgsql: Clarify initdb --sync-only help message and docs

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2021-08-16 15:00:18 Re: POC: Cleaning up orphaned files using undo logs
Previous Message Alvaro Herrera 2021-08-16 14:22:50 Re: Some RELKIND macro refactoring