Re: reassure me that it's good to copy pg_control last in a basebackup

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: reassure me that it's good to copy pg_control last in a basebackup
Дата
Msg-id 20171222060700.GC15816@paquier.xyz
обсуждение исходный текст
Ответ на Re: reassure me that it's good to copy pg_control last in a basebackup  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
On Fri, Dec 22, 2017 at 12:46:01AM -0500, Chapman Flack wrote:
> I was noticing that terminology in the long backup-from-standby thread
> I was reading, but it wasn't clear to me how the terms originated.
> What's exclusive about pg_start_backup/copy/pg_stop_backup? And what's
> nonexclusive about pg_basebackup (which, AFAICS, is following roughly
> the same sequence under the hood)?

You can run an exclusive backup only once at a time in a given PostgreSQL
server as it uses the on-disk backup_label file to determine the state the
server is in, while non-exclusive backups can be run across many sessions,
at the cost that you need to maintain the session alive for the duration
of the backup. pg_basebackup uses always non-exclusive backups, so it
never creates an on-disk backup_label file on the instance from which the
backup is taken but it writes the file by itself. pg_start_backup and
pg_stop_backup include a set of optional arguments to control if you want
to do a non-exclusive or an exclusive backup, the default being exclusive.
Non-exclusive backups can also be run while an exclusive backup is running.

> By the way, what does happen in that case? I'm guessing it wakes up,
> sees the backup_label file, decides it's doing a PITR, and starts
> replaying already-applied WAL from the start-of-backup checkpoint,
> rather than from the most recent one? Oops.

In short, yes. And it does not find the backup end record as well.
--
Michael

Вложения

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

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: [HACKERS] Restricting maximum keep segments by repslots
Следующее
От: Adam Lee
Дата:
Сообщение: Should we nonblocking open FIFO files in COPY?