Re: [HACKERS] logical decoding of two-phase transactions

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: "wangsh(dot)fnst(at)fujitsu(dot)com" <wangsh(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, "osumi(dot)takamichi(at)fujitsu(dot)com" <osumi(dot)takamichi(at)fujitsu(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: 2021-03-15 09:18:46
Message-ID: CAHut+Psk4-TxifSaChuKvpne2h0WyWOW8o50YuhGhSfCDg+cSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Mar 14, 2021 at 1:52 PM wangsh(dot)fnst(at)fujitsu(dot)com
<wangsh(dot)fnst(at)fujitsu(dot)com> wrote:
>
> Hi,
>
> I noticed in patch v58-0001-Add-support-for-apply-at-prepare-time-to-built-i.patch
>
> > +static void
> > +prepare_spoolfile_name(char *path, int szpath, Oid subid, char *gid)
> > +{
> > + PsfHashEntry *hentry;
> > +
> > + /*
> > + * This name is used as the key in the psf_hash HTAB. Therefore, the name
> > + * and the key must be exactly same lengths and padded with '\0' so
> > + * garbage does not impact the HTAB lookups.
> > + */
> > + Assert(sizeof(hentry->name) == MAXPGPATH);
> > + Assert(szpath == MAXPGPATH);
> > + memset(path, '\0', MAXPGPATH);
> > +
> > + snprintf(path, MAXPGPATH, "%s/psf_%u_%s.changes", PSF_DIR, subid, gid);
> > +}
>
> The variable hentry is only used when --enable-cassert is specified, it will be a warning if I don't specify the
> --enable-cassert when execute configure
>
> And the comment says the lengths are same, I think ' Assert(sizeof(hentry->name) == szpath) ' will be better.
>

Thanks for your feedback comment.

But today Amit suggested [ak0315] that the current psf logic should
all be replaced, after which the function you commented about will no
longer exist.

----
[ak0315] https://www.postgresql.org/message-id/CAA4eK1LVEdPYnjdajYzu3k6KEii1%2BF0jdQ6sWnYugiHcSGZD6Q%40mail.gmail.com

Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message houzj.fnst@fujitsu.com 2021-03-15 09:35:58 RE: Parallel INSERT (INTO ... SELECT ...)
Previous Message Kyotaro Horiguchi 2021-03-15 08:51:31 Re: shared-memory based stats collector