Re: pg_xlog - files are guaranteed to be sequentialy named?

Поиск
Список
Период
Сортировка
От Greg Smith
Тема Re: pg_xlog - files are guaranteed to be sequentialy named?
Дата
Msg-id Pine.GSO.4.64.0706131132240.3220@westnet.com
обсуждение исходный текст
Ответ на Re: pg_xlog - files are guaranteed to be sequentialy named?  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: pg_xlog - files are guaranteed to be sequentialy named?
Список pgsql-general
On Wed, 13 Jun 2007, Alvaro Herrera wrote:

> Johannes Konert wrote:
>> I currently write a small script that deletes outdated xlog-files from
>> my backup-location.
>
> Warning, this is NOT SAFE to do.  You should NEVER delete "outdated"
> xlog files, unless you appreciate RANDOM CORRUPTION of your data.

He's talking about wiping out the ones on the backup server, so I think
Johannes means erasing the old archived logs on the secondary here.  That
can screw up your backup if you do it wrong, but it's not an all-caps
worthy mistake.

On Wed, 13 Jun 2007, Johannes Konert wrote:
> Because I do not want to rely on creation-date,

No, you want to rely on creation date, because then this problem goes
away.  The idea you should be working toward is that you identify when
your last base backup was started after it's copied to the secondary, and
then you can safely delete any archived logs file on the secondary from
before that time.  Instead of doing "ls | sort -g -r" you should be doing
something like looping over the files in a bash shell script and using
[ -ot <first xlog in base backup> ] to determine which files to delete.

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD

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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: pg_xlog - files are guaranteed to be sequentialy named?
Следующее
От: Greg Smith
Дата:
Сообщение: Re: pointer to feature comparisons, please