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

From: Marco Slot <marco(dot)slot(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Dave Cramer <davecramer(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How is this possible "publication does not exist"
Date: 2022-08-04 08:56:45
Message-ID: CAFMSG9G04uX+rZiphL5_MjrBi4bPP7kLm77zNT7JX5sabBQ=aw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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 log on the publisher then repeatedly shows:
2022-08-04 10:46:56.140 CEST [12785] ERROR: publication "local_pub"
does not exist
2022-08-04 10:46:56.140 CEST [12785] CONTEXT: slot "test", output
plugin "pgoutput", in the change callback, associated LSN 8/6C01A270
2022-08-04 10:46:56.140 CEST [12785] STATEMENT: START_REPLICATION
SLOT "test" LOGICAL 0/0 (proto_version '2', publication_names
'"local_pub"')

(fails in the same way when setting up the subscription on a different node)

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.

cheers,
Marco

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Geier 2022-08-04 09:35:40 Re: Reducing planning time on tables with many indexes
Previous Message Thomas Munro 2022-08-04 08:38:34 Re: Mingw task for Cirrus CI