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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, 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-17 07:37:45
Message-ID: CAFiTN-tVDfPL9i9MnkEpXMT9ZKv0jbSHWJE2mpYbX+qPXCjByA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Aug 17, 2021 at 12:06 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

> One more comment:
> @@ -2976,39 +2952,17 @@ subxact_info_write(Oid subid, TransactionId xid)
> ..
> + /* Try to open the subxact file, if it doesn't exist then create it */
> + fd = BufFileOpenShared(xidfileset, path, O_RDWR, true);
> + if (fd == NULL)
> + fd = BufFileCreateShared(xidfileset, path);
> ..
>
> Instead of trying to create the file here based on whether it exists
> or not, can't we create it in subxact_info_add where we are first time
> allocating memory for subxacts? If that works then in the above code,
> the file should always exist.

One problem with this approach is that for now we delay creating the
subxact file till the end of the stream and if by end of the stream
all the subtransactions got aborted within the same stream then we
don't even create that file. But with this suggestion, we will always
create the file as soon as we get the first subtransaction.

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

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Dilip Kumar 2021-08-17 08:00:06 Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o
Previous Message Amit Kapila 2021-08-17 06:36:37 Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-08-17 07:47:44 Re: Two patches to speed up pg_rewind.
Previous Message 李杰 (慎追) 2021-08-17 07:06:09 回复:A problem in ExecModifyTable