X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 4FDCC9FB1D7 for ; Thu, 7 Sep 2006 20:11:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 16459-02 for ; Thu, 7 Sep 2006 20:11:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id B41469FA298 for ; Thu, 7 Sep 2006 20:11:23 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k87NBJCn000582; Thu, 7 Sep 2006 19:11:19 -0400 (EDT) To: "Chris Hoover" cc: "Alvaro Herrera" , pgsql-admin@postgresql.org Subject: Re: Why so long between archive calls? In-reply-to: <1d219a6f0609071302yabbebd0rcc018cbff3d2858e@mail.gmail.com> References: <1d219a6f0608290835u6647a8e1g437dfd4cedb81658@mail.gmail.com> <24247.1157059093@sss.pgh.pa.us> <1d219a6f0609011230t2407cba5u53a5e536ad4fbc20@mail.gmail.com> <25848.1157153334@sss.pgh.pa.us> <20060902014010.GA14288@alvh.no-ip.org> <26777.1157161705@sss.pgh.pa.us> <1d219a6f0609051333t70e1207eife3d0ad7a55a2e07@mail.gmail.com> <23808.1157572848@sss.pgh.pa.us> <1d219a6f0609061313q5f94ab54l9e84211e8b43c8fd@mail.gmail.com> <24338.1157576070@sss.pgh.pa.us> <1d219a6f0609071302yabbebd0rcc018cbff3d2858e@mail.gmail.com> Comments: In-reply-to "Chris Hoover" message dated "Thu, 07 Sep 2006 16:02:34 -0400" Date: Thu, 07 Sep 2006 19:11:19 -0400 Message-ID: <581.1157670679@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.113 tagged_above=0 required=5 tests=AWL, SPF_HELO_PASS, SPF_PASS X-Spam-Level: X-Archive-Number: 200609/70 X-Sequence-Number: 22984 "Chris Hoover" 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