At Thu, 4 Aug 2022 10:56:45 +0200, Marco Slot <marco.s...@gmail.com> wrote in > On Wed, Aug 11, 2021 at 1:37 PM Amit Kapila <amit.kapil...@gmail.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