Re: consistent postgresql snapshot

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: consistent postgresql snapshot
Date: 2022-05-11 23:50:43
Message-ID: 1ba59e2c-b0ae-387f-1272-cdbeefe7bd67@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 5/11/22 10:41, Zwettler Markus (OIZ) wrote:
>
> PostgreSQL12 running on CentOS7 + ext4.
>
> Would it be save to do a "fsfreeze –freeze" + disk snapshot + "fsfreeze
> –unfreeze" of the PGDATA filesystem to get a consistent snapshot?
>
> I am wondering as PostgreSQL default blocksize = 8k while ext4 default
> blocksize = 4k, resulting in 2 fs blocks per db block.
>

If data/base and pg_xlog are on the same filesystem, then it might work.

Be sure to select pg_start_backup('something informative'); beforehand, and
select pg_stop_backup(); afterwards.

For example:
psql -c "select pg_start_backup('something informative');"
fsfreeze –freeze
/disk snapshot/
fsfreeze –unfreeze
psql -c "select pg_stop_backup();"

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Gauthier 2022-05-12 00:01:36 effects of nullifying bytea column on storage
Previous Message Bryn Llewellyn 2022-05-11 23:45:00 Re: Deferred constraint trigger semantics