pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Nikhil Shetty <nikhil.dba04@gmail.com>
Cc: Victor Sudakov <vas@sibptus.ru>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Lost replication slots after pg_upgrade.
Date: Tue, 8 Feb 2022 15:04:04 +0800
Message-ID: <20220208070404.d2dizlt6nvz2g3og@jrouhaud> (raw)
In-Reply-To: <CAFpL5VxJiFdZ=UKAGNEqNo=U3eSDSFx1uabrrst-GJu2z3zqUg@mail.gmail.com>
References: <CAFpL5Vws1tJnO8_CeOBO6e2q5K4Zbe4==redhV1yLSekm1U4TQ@mail.gmail.com>
	<Yftm6IwtRKg5QB7P@admin.sibptus.ru>
	<CAFpL5Vx__E4hfvvoCQOmGEtAygowJzto_=sQHUTNbXOpUo1PUQ@mail.gmail.com>
	<YgHkxM8Ocn4F3zWi@admin.sibptus.ru>
	<CAFpL5VxJiFdZ=UKAGNEqNo=U3eSDSFx1uabrrst-GJu2z3zqUg@mail.gmail.com>

Hi,

On Tue, Feb 08, 2022 at 12:24:56PM +0530, Nikhil Shetty wrote:
> 
> I am doing a major version upgrade from pg 11 to 13. The point is if I lose
> the replication slot after upgrade then how will I sync standby from
> primary after rsync.
> 
> I can create the slot after upgrading but won't there be dataloss?

The replication slots are only there to make sure that the primary server won't
remove needed WALs before the standby can retrieve them.  Unless you start
production activity just after the pg_upgrade and before finishing rebuilding
the secondary there shouldn't be enough activity to lead to removing old WALs.
But if you do, you can create the needed replication slot(s) manually just
after the pg_upgrade.  But as already mentioned, I also recommend using
pg_basebackup for rebuilding the standby server(s).

> pg_basebackup takes time for large databases (> 5TB). I feel rsync should
> be faster.

Not necessarily.  pg_basebackup will do simple sequential read of all the data,
which is probably the fastest thing to do.  rsync will do some extra processing
that isn't required in that scenario, so it's likely to be slower (although
probably only marginally slower).





view thread (16+ messages)  latest in thread

Message-ID: <20220208070404.d2dizlt6nvz2g3og@jrouhaud>
Permalink:  ../20220208070404.d2dizlt6nvz2g3og@jrouhaud/
Also on:    postgresql.org/message-id/20220208070404.d2dizlt6nvz2g3og@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-admin@postgresql.org
  Cc: rjuju123@gmail.com, nikhil.dba04@gmail.com, vas@sibptus.ru, pgsql-admin@lists.postgresql.org
  Subject: Re: Lost replication slots after pg_upgrade.
  In-Reply-To: <20220208070404.d2dizlt6nvz2g3og@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