Re: AW: [Extern] Re: consistent postgresql snapshot

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: AW: [Extern] Re: consistent postgresql snapshot
Дата
Msg-id 308684.1652363307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на AW: [Extern] Re: consistent postgresql snapshot  ("Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch>)
Ответы Re: AW: [Extern] Re: consistent postgresql snapshot  (Nick Cleaton <nick@cleaton.net>)
Список pgsql-general
"Zwettler Markus (OIZ)" <Markus.Zwettler@zuerich.ch> writes:
> I don't want to do use the normal backup algorithm where pg_start_backup + pg_stop_backup will fix any fractured
blockand I am required to have all archived logfiles, therefore. 
> I want to produce an atomic consistent disk snapshot.

[ shrug... ]  You can't have that.  There is never any guarantee that
the on-disk database files are fully up-to-date while the Postgres
server is running, because there may be updates sitting in buffers
in shared memory that have not been written out yet.  We achieve
crash safety by ensuring that the WAL log contains sufficient info to
recreate any such updates by replaying WAL from the last checkpoint.
But without going through that replay process, the data visible in
the filesystem may be inconsistent.  Even taking a disk snapshot
immediately after a checkpoint won't help, because we use spread
checkpoints.  These points are independent of the possibility that
any one block write is non-atomic, although that's surely a factor
as well.

The only way you could get a consistent on-disk image is to shut
the server down (being sure to do a clean not "immediate" shutdown)
and then take the snapshot.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Neeraj M R
Дата:
Сообщение: Restricting user to see schema structure
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Fedora 36