Re: Running rsync backups in pg15

From: Doug Reynolds <mav(at)wastegate(dot)net>
To: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Running rsync backups in pg15
Date: 2024-11-07 19:49:51
Message-ID: 01000193082d1077-34d9461d-49e4-44ef-b83a-0201df4fc0ba-000000@email.amazonses.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I would be curious to see how long it would take to restore a 5TB database from each WAL ever created on the system.

We used to do a similar process with Oracle on a 30TB database years ago, but it literally took 26-28 hours to do a full backup.


Doug



On Nov 7, 2024, at 1:05 PM, Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:








On Thu, Nov 7, 2024 at 12:47 PM Evan Rempel <erempel(at)uvic(dot)ca> wrote:





We use a similar approach, but instead of using rsync, we use our backup software directly which is an incremental forever tool. Allows backup of TB DBs in short minutes. Switching to pgbackrest is actually a step backwards for us.





Last night's pgbackrest incremental backup of a 5.1TB database took a whopping 92 seconds.  How's that a backwards step?




Sure, the weekly full backup takes 84 minutes, but that's in so way shape or form painfully slow.


 




But as the OP states, if you have to keep the postgresql session open for the pg_start_backup and the pg_stop_backup then we will have to do a significant architectual change.





Anyone know if there is a straight forward way to allows the pg_start_backup and the pg_stop_backup to be run in different sessions?







--


Evan







From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>

Sent: November 7, 2024 9:34 AM

To: pgsql-admin(at)postgresql(dot)org <pgsql-admin(at)postgresql(dot)org>

Subject: Re: Running rsync backups in pg15

 



On Thu, Nov 7, 2024 at 11:35 AM Murthy Nunna <mnunna(at)fnal(dot)gov> wrote:


Hi,

 

In PG14 and earlier, there is no requirement to keep database connection while rsync is in progress. However, there is a change in PG15+ that requires rsync to be while we have the same database session open that executes SELECT pg_backup_start('label'). This change requires a rewrite of existing scripts we have.

 

Currently (pg14):

 

                In bash script (run from cron)


psql Select pg_start_backup

rsync

psql Select pg_stop_backup


 

In pg15 and later:

 

In bash script (run from cron)

 

psql

Select pg_start_backup

! run-rsync-script

Select pg_stop_backup

 

It can be done, but it makes it ugly to check errors and so forth that occur in the rsync script.

 

Anybody found an elegant way of doing this?





Run pgbackrest instead of rsync,




--


Death to <Redacted>, and butter sauce.


Don't boil me, I'm still alive.


<Redacted> lobster!







--


Death to <Redacted>, and butter sauce.

Don't boil me, I'm still alive.


<Redacted> lobster!





In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Murthy Nunna 2024-11-07 20:58:43 RE: Running rsync backups in pg15
Previous Message Gerald Drouillard 2024-11-07 18:23:29 Re: Running rsync backups in pg15