Re: Why so long between archive calls? - Mailing list pgsql-admin

From Tom Lane
Subject Re: Why so long between archive calls?
Date
Msg-id 581.1157670679@sss.pgh.pa.us
Whole thread Raw
In response to Re: Why so long between archive calls?  ("Chris Hoover" <revoohc@gmail.com>)
List pgsql-admin
"Chris Hoover" <revoohc@gmail.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

pgsql-admin by date:

Previous
From: "Chris Hoover"
Date:
Subject: Re: Why so long between archive calls?
Next
From: pgsql.maricau@a-bc.net
Date:
Subject: dynamic or static