Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools? - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?
Date
Msg-id e07983a4d1cd0b5df43f2e5fcdfdb6f43ea0eb75.camel@cybertec.at
Whole thread Raw
In response to RE: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?  (HECTOR INGERTO <hector_25e@hotmail.com>)
Responses RE: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?
List pgsql-general
On Mon, 2023-01-16 at 08:41 +0000, HECTOR INGERTO wrote:
> I have understood I shall not do it, but could the technical details be discussed about
> why silent DB corruption can occur with non-atomical snapshots?

The database relies on the data being consistent when it performs crash recovery.
Imagine that a checkpoint is running while you take your snapshot.  The checkpoint
syncs a data file with a new row to disk.  Then it writes a WAL record and updates
the control file.  Now imagine that the table with the new row is on a different
file system, and your snapshot captures the WAL and the control file, but not
the new row (it was still sitting in the kernel page cache when the snapshot was taken).
You end up with a lost row.

That is only one scenario.  Many other ways of corruption can happen.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com



pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Why is a Read-only Table Gets Autovacuumed "to prevent wraparound"
Next
From: Laurenz Albe
Date:
Subject: Re: glibc initdb options vs icu compatibility questions (PG15)