Re: Is file system replication sufficient to recovery?

From: Tom Korach <tom(at)safekeep(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Is file system replication sufficient to recovery?
Date: 2021-12-30 19:30:54
Message-ID: CALQRbyzu=Ov_KJd57+m+AwL0MQHiM=FtvOTkh=84rOpY9in0sw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

> Maybe I'm missing something, but AFAIK plain old RAID will not protect
> you against any scenario except failure of a single disk. It certainly
> won't do anything to help you revert to a prior database state.

The idea for RAID came from
https://www.postgresql.org/docs/current/different-replication-solutions.html
File System (Block Device) Replication

A modified version of shared hardware functionality is file system
replication, where all changes to a file system are mirrored to a file
system residing on another computer. The only restriction is that the
mirroring must be done in a way that ensures the standby server has a
consistent copy of the file system — specifically, writes to the standby
must be done in the same order as those on the primary. DRBD is a popular
file system replication solution for Linux.
DRBD seems to work similar to RAID but over network, but I might be wrong.

According to that link (
https://www.postgresql.org/docs/current/backup-file.html)
> An alternative file-system backup approach is to make a “consistent
snapshot” of the data directory, if the file system supports that
functionality (and you are willing to trust that it is implemented
correctly).
> The typical procedure is to make a “frozen snapshot” of the volume
containing the database

So could the following backup architecture make sense?
1. Periodic snapshots using EBS mechanism (to get consistent snapshots).
2. Periodic pg_basebackup + WAL file archiving ( to allow reverting to a
previous step if we e.g. mistakenly drop a table).

Thanks,
Tom
On Thu, Dec 30, 2021 at 12:52 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Tom Korach <tom(at)safekeep(dot)com> writes:
> >> What do you mean exactly by "file-system replication"?
>
> > RAID1 setup (specifically, between two disks or EBS volumes [on AWS]),
> > using LVM.
>
> Maybe I'm missing something, but AFAIK plain old RAID will not protect
> you against any scenario except failure of a single disk. It certainly
> won't do anything to help you revert to a prior database state.
>
> The docs page I pointed you to is part of a chapter that lays out all
> the backup methods the PG community considers reliable. I strongly
> suggest sticking to one of those and not trying to take shortcuts.
> (The following chapter on high-availability setups is relevant
> reading as well.)
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Paul Carlucci 2021-12-30 21:30:00 Re: Is file system replication sufficient to recovery?
Previous Message Tom Lane 2021-12-30 17:52:11 Re: Is file system replication sufficient to recovery?