Thread: pg_upgrade question

pg_upgrade question

From
Alan Stange
Date:
Hello all,

We're running a 13.x installation and looking to upgrade to 14.1.  This
is all on Linux servers.   We have a main instance running with a number
of hot standby replicas configured.   In the past, we have done a
dump/restore on a slow evening and then rsynced all the bits around so
that the main server and all replicas were identical at the start.   The
database has gotten larger now (~1TB) so that is a less desirable option.

So I am thinking to do a pg_upgrade --link on each of the main and the
hot standby replicas, and then restarting all the processes.   I'm sure
this will work fine on the main server, but I have not seen any mention
of this working in the expected way on the hot standby replicas.   Can
someone confirm that the steps I described here will work in the way I
am optimistically expecting it will?

I should mention that we are running on ZFS, and will take a snapshot
prior to the upgrade, so that if something goes sideways with our use of
--link  we can revert back instantly. 

Thank you,

Alan



Re: pg_upgrade question

From
Adrian Klaver
Date:
On 12/2/21 08:05, Alan Stange wrote:
> Hello all,
> 
> We're running a 13.x installation and looking to upgrade to 14.1.  This
> is all on Linux servers.   We have a main instance running with a number
> of hot standby replicas configured.   In the past, we have done a
> dump/restore on a slow evening and then rsynced all the bits around so
> that the main server and all replicas were identical at the start.   The
> database has gotten larger now (~1TB) so that is a less desirable option.
> 
> So I am thinking to do a pg_upgrade --link on each of the main and the
> hot standby replicas, and then restarting all the processes.   I'm sure
> this will work fine on the main server, but I have not seen any mention
> of this working in the expected way on the hot standby replicas.   Can
> someone confirm that the steps I described here will work in the way I
> am optimistically expecting it will?

Have you looked at steps 9 & 11 here?:

https://www.postgresql.org/docs/current/pgupgrade.html

> 
> I should mention that we are running on ZFS, and will take a snapshot
> prior to the upgrade, so that if something goes sideways with our use of
> --link  we can revert back instantly.
> 
> Thank you,
> 
> Alan
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Re: pg_upgrade question

From
Alan Stange
Date:
Of course that would be in the manual ;-)   Thank you for pointing this
out.   We've been doing upgrades the reliable old school way for so long
that I wasn't aware that something better was already well documented.

Thank you,

Alan

On 12/2/21 11:10, Adrian Klaver wrote:
> On 12/2/21 08:05, Alan Stange wrote:
>> Hello all,
>>
>> We're running a 13.x installation and looking to upgrade to 14.1.  This
>> is all on Linux servers.   We have a main instance running with a number
>> of hot standby replicas configured.   In the past, we have done a
>> dump/restore on a slow evening and then rsynced all the bits around so
>> that the main server and all replicas were identical at the start.   The
>> database has gotten larger now (~1TB) so that is a less desirable option.
>>
>> So I am thinking to do a pg_upgrade --link on each of the main and the
>> hot standby replicas, and then restarting all the processes.   I'm sure
>> this will work fine on the main server, but I have not seen any mention
>> of this working in the expected way on the hot standby replicas.   Can
>> someone confirm that the steps I described here will work in the way I
>> am optimistically expecting it will?
> Have you looked at steps 9 & 11 here?:
>
> https://www.postgresql.org/docs/current/pgupgrade.html
>
>> I should mention that we are running on ZFS, and will take a snapshot
>> prior to the upgrade, so that if something goes sideways with our use of
>> --link  we can revert back instantly.
>>
>> Thank you,
>>
>> Alan
>>
>>
>