From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Anders Bøgh Bruun <anders@cellpointmobile.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Logical replication troubles
Date: Wed, 20 May 2020 15:00:35 +0200
Message-ID: <7ad3f1d0-b9ee-d914-ad57-16f07686ee9d@2ndquadrant.com> (raw)
In-Reply-To: <CAMnwvPwBgkmaMZapP_wgXZwxGZymuaYuqNykGLiMG4K+rGmBaQ@mail.gmail.com>
References: <CAMnwvPwBgkmaMZapP_wgXZwxGZymuaYuqNykGLiMG4K+rGmBaQ@mail.gmail.com>
On 2020-05-19 09:22, Anders Bøgh Bruun wrote:
> I have run into a (to me) weird issue with logical replication. We are
> running Zalandos postgres-operator in our Kubernetes clusters and have
> recently had a use-case where we wanted to start doing logical
> replication of select tables to a data warehouse, also running postgres.
> It worked as expected at first, but then after a pod-restart in
> Kubernetes, the replication slots that were created for the subscription
> were gone. A bit of reading later, and I learn we need to tell Patroni
> which slots should be permanently available, so we specify a slot and
> try to set this up, but then run into an error which says the
> publication does not exist, even though we can verify that it does. At
> first I suspected Patroni handling the replication slots to be the cause
> of the problem, but about a week's worth of learning and experimenting
> later, I can now reliably replicate the problem in pure postgres.
> Patroni is kind of the catalyst, since my findings are that if the
> replication slot is created before data is inserted into the source
> database, and a publication is created, then it breaks. If the
> replication slot is created after data is inserted and the publication
> is created, then it works. We just can't tell Patroni to not create it
> until some arbitrary point in time. I am guessing this is either a bug
> or a case of us not knowing what we are doing...
What does "works" and "breaks" mean? Are there error messages shown
from commands or in the server logs? Is replication progressing, but
doing something your are not expecting? etc.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: peter.eisentraut@2ndquadrant.com, anders@cellpointmobile.com
Subject: Re: Logical replication troubles
In-Reply-To: <7ad3f1d0-b9ee-d914-ad57-16f07686ee9d@2ndquadrant.com>
References: <CAMnwvPwBgkmaMZapP_wgXZwxGZymuaYuqNykGLiMG4K+rGmBaQ@mail.gmail.com> <7ad3f1d0-b9ee-d914-ad57-16f07686ee9d@2ndquadrant.com>
* 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