Re: Backup of live database

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Backup of live database
Дата
Msg-id 23635.1200496752@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Backup of live database  (Steve Holdoway <steve.holdoway@firetrust.com>)
Ответы Re: Backup of live database  (Peter Eisentraut <peter_e@gmx.net>)
Re: Backup of live database  (Steve Holdoway <steve.holdoway@firetrust.com>)
Список pgsql-admin
Steve Holdoway <steve.holdoway@firetrust.com> writes:
> You can be absolutely certain that the tar backup of a file that's changed is a complete waste of time. Because it
changedwhile you were copying it.  

That is, no doubt, the reasoning that prompted the gnu tar people to
make it do what it does, but it has zero to do with reality for
Postgres' usage in PITR base backups.  What we care about is consistency
on the page level: as long as each page of the backed-up file correctly
represents *some* state of that page while the backup was in progress,
everything is okay, because replay of the WAL log will correct any pages
that are out-of-date, missing, or shouldn't be there at all.  And
Postgres always writes whole pages.  So as long as write() and read()
are atomic --- which is the case on all Unixen I know of --- everything
works.

(Thinks for a bit...) Actually I guess there's one extra assumption in
there, which is that tar must issue its reads in multiples of our page
size.  But that doesn't seem like much of a stretch.

            regards, tom lane

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Backup of live database
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Backup of live database