Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 74DE31337B68 for ; Tue, 12 Apr 2011 13:33:46 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 49686-01 for ; Tue, 12 Apr 2011 16:33:39 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id 3E4851337990 for ; Tue, 12 Apr 2011 13:33:39 -0300 (ADT) Received: by vws1 with SMTP id 1so5190928vws.19 for ; Tue, 12 Apr 2011 09:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=8XXoq4lZqGWlirMhlU82ID/IPCKfdpAK8r6e/2V2fFo=; b=I4WsOK4G/xXRGe6Jif2bXw0x1sEhjl8VVkeKdyeeClik5ALk5HESkbyUpmo8b9AH9Z EfQujTMqwSMDIQqApc6KEORgvMoZIAI50ydpdZ2+dRFcdauVYJHGiyBPT1oh0ComclKE nGdtgY+DuiBogxyURm0+AJIQD5uplpnUJbG5E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LiH9C32qIro/dhLf9Uciu/Df8V7b3y+vzwZUWPz8Bj438zioymwu4USUjiT02dCz2g u6gME1QEQFDA6i0R3vaTATt802VWV5m8/1YTX/O4cnVNPQ7bCl+WcduNTJfnKyy6J9Tc rrX5QOr6uNS3jg2RhuNbqFnJ6CovcyJ9/jWx0= MIME-Version: 1.0 Received: by 10.52.68.99 with SMTP id v3mr5229773vdt.217.1302626018073; Tue, 12 Apr 2011 09:33:38 -0700 (PDT) Received: by 10.52.156.230 with HTTP; Tue, 12 Apr 2011 09:33:37 -0700 (PDT) Date: Tue, 12 Apr 2011 17:33:37 +0100 Message-ID: Subject: WAL archiving disaster From: Mike Atkin To: pgsql-admin@postgresql.org Content-Type: text/plain; charset=UTF-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.889 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201104/117 X-Sequence-Number: 37298 Hi all, One of my postgres 8.2 databases had been getting critically low on disk space and with no extra suitable hardware available to accommodate it I decided I would use amazon S3 to store the blob data which was taking up most of the room. The plan was that I could then do a vacuumlo and then a full vacuum on the database and reclaim the space. The S3 part went fine but when I came to run the vacuumlo the disk was so full that it didn't have space for the temporary tables that created. The database was so big that pg_dumping onto another machine would take an age so I decided I could get around this by using the continuous WAL backup to restore the cluster onto my desktop which had plenty of room and was local to the backup. So off I went - restored, vacuumed, dumped, verified, uploaded, dropped the original and finally restored again where it came from only much smaller. Fantastic. This is the point where I discovered that after years of stirling service my WAL archiving script had failed to transport a single segment during a brief ISP outage a week ago despite having coped with these before, and had resulted in the restore terminating prematurely leaving me minus the last week's worth of data. In my rush I had failed to properly check that the last restored segment matched the last one in the archive and I had now dropped the original db so performing another base backup would get me nowhere ;-( So... normally this would be curtains for the database but the missing segment is from a 4 hour period of practically zero activity. It was only archived because it hit the archive_timeout. Is there any way I can force postgres to ignore this segment and attempt to redo the rest of the logs. I realise this may leave the database terminally inconsistent but my focus is on retrieving as much of the data as possible for re-entry rather than getting a functional system out the other end. The other option is parsing the rest of the logs to produce a list of human readable changes that could then be manually entered back into the week-old system. I've seen various references to tools that attempted this in the past but are now unmaintained. Is anyone aware of any current tools or of the amount of work required to implement such a tool? Any help gratefully received, Mike