From: Michael Paquier <michael@paquier.xyz>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: vignesh21@gmail.com, sawada.mshk@gmail.com, wangsh.fnst@fujitsu.com, osumi.takamichi@fujitsu.com, pgsql-bugs@lists.postgresql.org, Andres Freund <andres@anarazel.de>
Subject: Re: "unexpected duplicate for tablespace" problem in logical replication
Date: Mon, 18 Mar 2024 15:35:38 +0900
Message-ID: <Zffgupps4Gv9BVXL@paquier.xyz> (raw)
In-Reply-To: <CA+TgmoYADF0ddp4JO_a8AiUDKCLFGTAw7ii8OniLBzmwVG8njg@mail.gmail.com>
References: <CALDaNm1NjZDJGEoYaRPMGsXrOMQwJ2bK4EXC-wvoSSM77XX95A@mail.gmail.com>
<20240112.173746.1710988914918513917.horikyota.ntt@gmail.com>
<CA+TgmoYuONjrkcSDJC60RoaVQ_q3JP5H4b-5uiK+tanONYJYbA@mail.gmail.com>
<20240116.105804.1924548897701268962.horikyota.ntt@gmail.com>
<CA+TgmoYADF0ddp4JO_a8AiUDKCLFGTAw7ii8OniLBzmwVG8njg@mail.gmail.com>
On Fri, Feb 02, 2024 at 10:49:17AM -0500, Robert Haas wrote:
> Andres, what do you think about this idea? I wonder if you just
> momentarily forgot about temporary relations when coding
> RelidByRelfilenumber -- because for that function to give well-defined
> answers with temporary relations included, it would need the backend
> ID as an additional argument.
No idea what Andres thinks, but seeing that pg_filenode_relation()
uses in input a tablespace OID and a filenode OID while ignoring the
prefix that would be used for a temp relation path (with a 't' and the
backend number), it is clear that the current function is not suited
to make the difference between temporary and persistent relations as
we'd need to have a priority order to choose one over the other. And
that may not lead to the correct choice.
Ignoring temporary relations entirely makes sense: one cannot get a
regclass from only a tablespace and a relfilenode, the persistence, as
well as a backend ID would also be required. I've not checked the
patch in details, but it's to say that the idea to cut temporary
relations sounds rather right here.
--
Michael
Attachments:
[application/pgp-signature] signature.asc (832B, ../Zffgupps4Gv9BVXL@paquier.xyz/2-signature.asc)
download
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, robertmhaas@gmail.com, horikyota.ntt@gmail.com, andres@anarazel.de
Subject: Re: "unexpected duplicate for tablespace" problem in logical replication
In-Reply-To: <Zffgupps4Gv9BVXL@paquier.xyz>
* 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