Re: Why so long between archive calls?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Hoover" <revoohc(at)gmail(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Why so long between archive calls?
Date: 2006-09-07 23:11:19
Message-ID: 581.1157670679@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Chris Hoover" <revoohc(at)gmail(dot)com> writes:
> I am able to tell how far behind the archiving is running since every
> minute, I copy the current archive_logs to a backup directory. This is
> allowing me to be able to do an up to the minute pitr if required. The
> archive_command removes the file from this backup dir when the file is
> archived by PostgreSQL.

> Here my script for that:

It looks to me like your script does not understand the difference
between xlog files that have been used and xlog files that haven't been
used yet. Since you've got checkpoint_segments = 256, the xlog code
will allow as many as 513 (2*checkpoint_segments+1) not-yet-used xlog
files to be allocated.

The only simple way to tell where the end of WAL is at the moment is to
look for the xlog file with the latest mod time. (There'll be more
support for this in 8.2.) Any files with names numerically larger than
that one are just sitting there waiting to be used, they are not
interesting for archiving purposes.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message pgsql.maricau 2006-09-08 04:52:07 dynamic or static
Previous Message Chris Hoover 2006-09-07 20:02:34 Re: Why so long between archive calls?