Re: Does pg_start_backup changes how Postgres writes data?

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Does pg_start_backup changes how Postgres writes data?
Дата
Msg-id CABUevEwnbhfPuVSg-+K8wZdptk0-bpqFA01a=vsqiZY-pixk6w@mail.gmail.com
обсуждение исходный текст
Ответ на Does pg_start_backup changes how Postgres writes data?  (Thorsten Schöning <tschoening@am-soft.de>)
Список pgsql-admin


On Mon, Jul 8, 2019 at 10:50 AM Thorsten Schöning <tschoening@am-soft.de> wrote:
Hi all,

we are reviewing our current backup process based on the low level
pg_start_backup and pg_stop_backup using the exclusive approach.
During a discussion with one of my coworkers he claimed that after
pg_start_backup executed, no writes into "the file system" happen
anymore. The only exception he makes is writes to the WAL.

That's incorrect. Writes still happen to the filesystem. Otherwise, the system might not be able to function properly if the backups take a long time.

The only difference to writing that pg_start_backup() does is that it forces full_page_writes to be on during the backup. The only difference to the non-wal part of the filesystem is the checkpoint, as you mention below.

(Also, you should really look into using the non-exclusive version of pg_start_backup(), as the exclusive one has several dangers to it. See the warnings and documentation under 25.3.3.2 at https://www.postgresql.org/docs/12/continuous-archiving.html#BACKUP-LOWLEVEL-BASE-BACKUP -- the same issues apply to previous versions, but the docs were less clear).



From what I understand from reading the docs and multiple other
sources, I have a different opinion: The only thing pg_start_backup
changes regarding writes in the data directory of Postgres is that a
checkpoint is done as part of starting the backup, even if no
checkpoint would be needed currently otherwise. After that is done,
from my understanding, Postgres is free to write any file in the
directory at any given time again however it sees fit. That's why
inconsistent files are mentioned at many places:

This is correct.

-- 

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

Предыдущее
От: Thorsten Schöning
Дата:
Сообщение: Does pg_start_backup changes how Postgres writes data?
Следующее
От: Thorsten Schöning
Дата:
Сообщение: Do results of pg_start_backup work without WAL segments created during backup?