Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9D8C81337BA4 for ; Mon, 28 Feb 2011 01:56:40 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 26956-07 for ; Mon, 28 Feb 2011 05:56:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og104.obsmtp.com (exprod7og104.obsmtp.com [64.18.2.161]) by mail.postgresql.org (Postfix) with ESMTP id A1F151337B9E for ; Mon, 28 Feb 2011 01:56:32 -0400 (AST) Received: from source ([209.85.213.45]) (using TLSv1) by exprod7ob104.postini.com ([64.18.6.12]) with SMTP ID DSNKTWs5DznqF4Giol+DgLLqPEecfz1VkMi3@postini.com; Sun, 27 Feb 2011 21:56:32 PST Received: by ywl41 with SMTP id 41so1418757ywl.4 for ; Sun, 27 Feb 2011 21:56:30 -0800 (PST) Received: by 10.150.185.14 with SMTP id i14mr6680593ybf.204.1298872590413; Sun, 27 Feb 2011 21:56:30 -0800 (PST) Received: from [192.168.1.2] ([122.169.64.43]) by mx.google.com with ESMTPS id q18sm1428440ybk.23.2011.02.27.21.56.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Feb 2011 21:56:29 -0800 (PST) Subject: Re: ERROR: missing chunk number 0 for toast value 382548694 in pg_toast_847386 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Vibhor Kumar In-Reply-To: Date: Mon, 28 Feb 2011 11:27:05 +0530 Cc: "pgsql-general@postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <82485929-8F56-4348-9F7F-4240D13042BF@enterprisedb.com> References: <132BC6A6-0C40-46BD-8CF3-43F23BD9A749@enterprisedb.com> To: Michael Harris X-Mailer: Apple Mail (2.1082) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201102/939 X-Sequence-Number: 173205 On Feb 28, 2011, at 10:13 AM, Michael Harris wrote: >>>=20 >>> Did you find anything suspicious in pg_log? >=20 > We've been through it all and did not see anything we didn't expect. >=20 >>> Please share recovery.conf information. >=20 > We did interrupt the restore a few times. The initial recovery.conf = file contained only: >=20 > restore_command =3D 'gunzip -c /mnt/dbsbackup/pg_xlog/%f.gz > %p' >=20 > Later we decided to replace the recovery command with a wrapper script = that would allow us to leave the restore going unattended over the = weekend, and complete up until the latest WAL file on the original = database (which is still running). We changed the recovery command to: >=20 > restore_command =3D '/var/lib/pgsql/data/db_restore_dm %f %p' >=20 > where the script db_restore_dm contained: >=20 > #!/usr/bin/perl >=20 > use strict; >=20 > my ($pg_f, $pg_p) =3D @ARGV; > exit 1 if $pg_f eq '00000001.history'; >=20 > my $xlogBackupFile =3D "/mnt/dbsbackup/pg_xlog/$pg_f.gz"; >=20 > while (! -f $xlogBackupFile and !$triggered) { > sleep 2; > } >=20 > while (1) { > system("gunzip -c $xlogBackupFile > $pg_p"); > last if ($? >> 8 =3D=3D 0); > sleep 2; > } Not sure about above wrapper function. However, if you can share some = information from pg_log when you have started the restore with = backup_label information. Try following steps: 1. Untar all the gzipped WAL File in One Location 2. Use Following restore command: cp /%f %p > We were concerned that shutting down / starting up while recovery is = ongoing might cause some problems, but the pg documentation indicates = this should be OK and we saw no cause for concern in the pg logs. What options have you used for shutting down? Thanks & Regards, Vibhor Kumar vibhor.kumar@enterprisedb.com Blog:http://vibhork.blogspot.com