Re: How is this possible "publication does not exist"

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: marco(dot)slot(at)gmail(dot)com
Cc: amit(dot)kapila16(at)gmail(dot)com, davecramer(at)gmail(dot)com, x4mmm(at)yandex-team(dot)ru, tomas(dot)vondra(at)2ndquadrant(dot)com, peter(dot)eisentraut(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: How is this possible "publication does not exist"
Date: 2022-08-05 04:09:44
Message-ID: 20220805.130944.1989619924314333193.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 4 Aug 2022 10:56:45 +0200, Marco Slot <marco(dot)slot(at)gmail(dot)com> wrote in
> On Wed, Aug 11, 2021 at 1:37 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> > I think it is and the context is generated via
> > output_plugin_error_callback. Is this reproducible for you and if so,
> > can you share a test case or some steps to reproduce this? Does this
> > work and suddenly start giving errors or it happens the very first
> > time you tried to set up publication/subscription? I think some more
> > details are required about your setup and steps to analyze this
> > problem. You might want to check publication-side logs but not sure if
> > get any better clue there.
>
> This seems to regularly reproduce the issue on PostgreSQL 14.4:
>
> drop subscription if exists local_sub;
> drop publication if exists local_pub;
> drop table if exists local;
>
> select pg_create_logical_replication_slot('test','pgoutput');
> create table local (x int, y int);
> insert into local values (1,2);
> create publication local_pub for table local;
> create subscription local_sub connection 'host=localhost port=5432'
> publication local_pub with (create_slot = false, slot_name = 'test',
> copy_data = false);

> The local_pub does appear in pg_publication, but it seems a bit like
> the change_cb is using an old snapshot when reading from the catalog
> in GetPublicationByName.

Yes. So the slot should be created *after* the publication is
created. A discussion [1] was held on allowing missing publications
in such a case but it has not been rached a conclusion..

[1] https://www.postgresql.org/message-id/CAA4eK1LwQAEPJMTwVe3UYODeNMkK2QHf-WZF5aXp5ZcjDRcrUA%40mail.gmail.com

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-08-05 04:10:02 Re: Handle infinite recursion in logical replication setup
Previous Message Dilip Kumar 2022-08-05 04:05:20 Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints