pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pg_upgrade and logical replication
Date: Tue, 28 Feb 2023 12:48:27 +0800
Message-ID: <20230228044827.u5surqffpytcewq3@jrouhaud> (raw)
In-Reply-To: <CAA4eK1JrQXqFtc7g7MJzM1TwX74fzFq3gi-neeyQuwJL77X6KQ@mail.gmail.com>
References: <CAA4eK1KW38JFR=PF47cDGmGyEUQPCbRXJ_wrT164ckv-8u1ijg@mail.gmail.com>
	<20230219000109.bohkpeoej7kariku@jrouhaud>
	<CAA4eK1KdY17CvwFhzNZxrX-iyB=d597E83cgPwyEtBB9dXb0sw@mail.gmail.com>
	<20230220070737.4y3xialppl3imcgz@jrouhaud>
	<20230222064318.t5cstjbjpef3uboi@jrouhaud>
	<CAA4eK1KD-hZ3syruxJA6fK-JtSBzL6etkwToPuTmVkrCvT6ASw@mail.gmail.com>
	<20230226030518.q6tggrid2vacmvlb@jrouhaud>
	<CAA4eK1LVQvJNvedxZWFna1Z-50F+Oy3ABZZv7UOM9W_uvMnMaA@mail.gmail.com>
	<20230228022548.zuzqyu33dbv5ppyx@jrouhaud>
	<CAA4eK1JrQXqFtc7g7MJzM1TwX74fzFq3gi-neeyQuwJL77X6KQ@mail.gmail.com>

On Tue, Feb 28, 2023 at 08:56:37AM +0530, Amit Kapila wrote:
> On Tue, Feb 28, 2023 at 7:55 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
> >
> >
> > The scenario I'm interested in is to rely on logical replication only for the
> > upgrade, so the end state (and start state) is to go back to physical
> > replication.  In that case, I would just create new physical replica from the
> > pg_upgrade'd server and failover to that node, or rsync the previous publisher
> > node to make it a physical replica.
> >
> > But even if you want to only rely on logical replication, I'm not sure why you
> > would want to keep the publisher node as a publisher node?  I think that doing
> > it this way will lead to a longer downtime compared to doing a failover on the
> > pg_upgrade'd node, make it a publisher and then move the former publisher node
> > to a subscriber.
> >
>
> I am not sure if this is usually everyone follows because it sounds
> like a lot of work to me. IIUC, to achieve this, one needs to recreate
> all the publications and subscriptions after changing the roles of
> publisher and subscriber. Can you please write steps to show exactly
> what you have in mind to avoid any misunderstanding?

Well, as I mentioned I'm *not* interested in a logical-replication-only
scenario.  Logical replication is nice but it will always be less efficient
than physical replication, and some workloads also don't really play well with
it.  So while it can be a huge asset in some cases I'm for now looking at
leveraging logical replication for the purpose of major upgrade only for a
physical replication cluster, so the publications and subscriptions are only
temporary and trashed after use.

That being said I was only saying that if I had to do a major upgrade of a
logical replication cluster this is probably how I would try to do it, to
minimize downtime, even if there are probably *a lot* difficulties to
overcome.





view thread (221+ messages)  latest in thread

Message-ID: <20230228044827.u5surqffpytcewq3@jrouhaud>
Permalink:  ../20230228044827.u5surqffpytcewq3@jrouhaud/
Also on:    postgresql.org/message-id/20230228044827.u5surqffpytcewq3@jrouhaud

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: rjuju123@gmail.com, amit.kapila16@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: pg_upgrade and logical replication
  In-Reply-To: <20230228044827.u5surqffpytcewq3@jrouhaud>

* 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