Обсуждение: Should *.backup files ever be removed from pg_xlog?

Поиск
Список
Период
Сортировка

Should *.backup files ever be removed from pg_xlog?

От
Bruce Momjian
Дата:
When you do a pg_start_backup()/pg_stop_backup(), the *.backup files
created in pg_xlog are never deleted.  Is that intended?
$ lf /u/pg/data/pg_xlog/000000010000000000000000.0034C96C.backup
000000010000000000000004000000010000000000000000.0034C9AC.backup       000000010000000000000005000000010000000000000002
                      000000010000000000000006000000010000000000000003                        archive_status/
 

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


Re: Should *.backup files ever be removed from pg_xlog?

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> When you do a pg_start_backup()/pg_stop_backup(), the *.backup files
> created in pg_xlog are never deleted.  Is that intended?

Yes.  See the documentation.  DBAs can delete 'em if they feel like,
but I don't see a strong argument for automatically removing 'em.
They aren't actually large ...
        regards, tom lane


Re: Should *.backup files ever be removed from pg_xlog?

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > When you do a pg_start_backup()/pg_stop_backup(), the *.backup files
> > created in pg_xlog are never deleted.  Is that intended?
> 
> Yes.  See the documentation.  DBAs can delete 'em if they feel like,
> but I don't see a strong argument for automatically removing 'em.
> They aren't actually large ...

I don't see anywhere in the documentation where we say you can get rid
of them.  I see this:
For example, if the starting WAL file is 0000000100001234000055CD thebackup history file will be named something
like0000000100001234000055CD.007C9330.backup.(The second number in the filename stands for an exact position within the
WALfile, and canordinarily be ignored.) Once you have safely archived the file systembackup and the WAL segment files
usedduring the backup (as specified inthe backup history file), all archived WAL segments with namesnumerically less
areno longer needed to recover the file system backupand may be deleted. However, you should consider keeping several
backupsetsto be absolutely certain that you are can recover your data. Keepin mind that only completed WAL segment
filesare archived, so therewill be delay between running pg_stop_backup and the archiving of allWAL segment files
neededto make the file system backup consistent.
 

The "all archived WAL segments with names numerically less are no longer
needed" I assume is talking about files in the archive location, not
pg_xlog.  Does this need clarifying?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073