From: Victor Sudakov <vas@sibptus.ru>
To: Vijaykumar Jain <vijaykumarjain.github@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Cc: Nikhil Shetty <nikhil.dba04@gmail.com>
Subject: Re: Lost replication slots after pg_upgrade.
Date: Thu, 3 Feb 2022 07:26:47 +0000
Message-ID: <YfuDt1LU4N0Wx8rR@admin.sibptus.ru> (raw)
In-Reply-To: <CAM+6J9774aZNoS=1=wKMcJZX0hEhQ0mL9BoO37qiDoAGi1dfcw@mail.gmail.com>
References: <CAFpL5Vws1tJnO8_CeOBO6e2q5K4Zbe4==redhV1yLSekm1U4TQ@mail.gmail.com>
<Yftm6IwtRKg5QB7P@admin.sibptus.ru>
<CAM+6J9774aZNoS=1=wKMcJZX0hEhQ0mL9BoO37qiDoAGi1dfcw@mail.gmail.com>
Vijaykumar Jain wrote:
> On Thu, Feb 3, 2022, 10:54 AM Victor Sudakov <vas@sibptus.ru> wrote:
>
> > Nikhil Shetty wrote:
> > > Hi,
> > > I have a Primary and Standby running on Postgres v11.7.
> > >
> > > I was following the document to upgrade a PG v11.7 cluster to PG v13.4.
> > > After upgrade using pg_upgrade on primary, I ran rsync to setup standby
> > > PG13 but when I started the primary, the replication slots were not
> > > present. How will standby start streaming in this case?
> > >
> > > We are using physical replication slots.
> >
> > You can create the replication slots manually with
> > pg_create_physical_replication_slot() any time.
> >
> > However, unless you are very brave and know what you are doing, I'd
> > recommend using pg_basebackup to setup a standby, not rsync. You can
> > even use the -C and -S options of pg_basebackup to create the slots
> > for you, and many other pg_basebackup's nice
> >
>
> A small demo of 11 to 13 upgrade using pg_upgrade and rsync.
> It might not be all the best practices, but just following the doc on my
> laptop.
>
> >
> https://gist.github.com/cabecada/4517af13245383b888833cfc69d741be
>
> Just ensure the backed up configs are in back in and also create the
> replication slot.
The black magick of using rsync instead of pg_basebackup is even
documented in https://www.postgresql.org/docs/13/pgupgrade.html but
it's much more difficult and error-prone than using pg_basebackup.
--
Victor Sudakov VAS4-RIPE
http://vas.tomsk.ru/
2:5005/49@fidonet
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-admin@postgresql.org
Cc: vas@sibptus.ru, vijaykumarjain.github@gmail.com, pgsql-admin@lists.postgresql.org, nikhil.dba04@gmail.com
Subject: Re: Lost replication slots after pg_upgrade.
In-Reply-To: <YfuDt1LU4N0Wx8rR@admin.sibptus.ru>
* 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