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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Should *.backup files ever be removed from pg_xlog?
Date: 2005-06-09 14:55:27
Message-ID: 200506091455.j59EtRY29962@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Tom Lane wrote:
> > Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > > I have fixed the code to properly remove *.backup files from the
> > > /pg_xlog directory once they are archived.
> >
> > I do not actually think that this is a good idea. The .backup files are
> > not large and they are pretty critical info --- so having multiple
> > copies of them seems like a good idea. We don't auto-remove timeline
> > history files either, for the same reason.
>
> I realize the files are small, but the number of entries in the
> directory might get pretty large. I am also worried about folks
> realizing we are not cleaning out those directories and mucking in there
> when they shouldn't --- I already got a private email asking why there
> are so many files in there and can they be cleared out. In fact, the
> archive_status/ directory also keeps *.done files for the backup files.
>
> We knowe we have archived the *.backup files. Are these files any use
> if we can't get the archive files restored?
>
> OK, how about if we do this cleanup when we do pg_stop_backup() so we
> delete any previous *.backup files, rather than do it as part of
> checkpoint.

OK, new version that removes old backup files only when pg_stop_backup()
is run. This way the current backup file will always be in pg_xlog/.

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

Attachment Content-Type Size
unknown_filename text/plain 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2005-06-09 15:29:35 Re: pg_config --configure ...
Previous Message Tom Lane 2005-06-09 14:49:34 Re: [HACKERS] Strange transaction-id behaviour? (was Re: Two updates problem)

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-06-09 15:29:08 Re: Troff -ms output for psql
Previous Message Neil Conway 2005-06-09 04:31:18 Re: final light versions of Oracle compatibility (SQLSTATE, GREATEST,