Re: "unexpected duplicate for tablespace" problem in logical replication
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: vignesh21@gmail.com
Cc: sawada.mshk@gmail.com, wangsh.fnst@fujitsu.com,
osumi.takamichi@fujitsu.com, pgsql-bugs@lists.postgresql.org
Date: 2024-01-12T08:37:46Z
Lists: pgsql-bugs
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Ignore temporary relations in RelidByRelfilenumber()
- 30b32b08c9e9 13.23 landed
- 222130edd81f 14.20 landed
- ec471008c8fc 15.15 landed
- ab874faaa1f3 16.11 landed
- dcdc95cb4d4c 17.7 landed
- 86831952ad60 18.0 landed
- ef03ea01fe47 19 (unreleased) landed
Attachments
- RelidByRelfilenumber_prefer_perm_rels_master.patch (text/x-patch) patch
- RelidByRelfilenumber_prefer_perm_rels_15-16.patch (text/x-patch) patch
- RelidByRelfilenumber_prefer_perm_rels_12-14.patch (text/x-patch) patch
- RelidByRelfilenumber_prefer_perm_rels_11.patch (text/x-patch) patch
At Mon, 8 Jan 2024 10:32:03 +0530, vignesh C <vignesh21@gmail.com> wrote in > I have changed the status to "Waiting on Author" as the points raised > by Masahiko Sawada-san is pending. Oops! This slipped off from my mind. Thank you for the reminder. > On Tue, 19 Apr 2022 at 11:54, Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > What do you think about this direction? > > > > Sounds good to me. If we go in this direction, probably we also need > > to change the cache checks in RelidByRelfilenode() so that we > > prioritize non-temporary relations. Otherwise, we will end up > > returning the OID of temporary relation if it's already cached. Maybe. It might be better for the cache not to register temprary relations at all. > > Another idea I came up with is that we have RelidByRelfilenode() check > > only non-temporary relations by adding relpersistence != > > RELPERSISTENCE_TEMP to the scan key. I'm not sure it is good considering the case pg_relationumber_relation for a temporary relation. > > If we want to support temporary > > relations too, I think that, in v16, we can add relpersistence to > > RelidByRelfilenode() as a function argument (and a flag to > > pg_filenode_relation() accordingly) so that the user can get the name > > of the temporary relation by like pg_filenode_relation(0, 16386, > > true). On the other hand, in back branches, if an application is using > > pg_filenode_relation() to get the name of temporary relations, it > > would break it. Agreed. So, the attachd files are the patches for the master and older versions respectively. If there is a concern with the patch for the master, the parameter handling of pg_filenode_relation might be not good. If the feature of searching for relations regardless of their persistence is unnecessary, it could be simplified. (Anyway it lacks documentation at all). Also, while the patch for version 11 is attached, I am unable to build this version on my system (although I haven't investigated this deeply, but I'm on Rocky 9 now). regards. -- Kyotaro Horiguchi NTT Open Source Software Center