Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv4Cm-0001iQ-PB for pgsql-admin@arkaria.postgresql.org; Tue, 15 Jan 2013 10:57:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tv4Cm-0006yk-7x for pgsql-admin@arkaria.postgresql.org; Tue, 15 Jan 2013 10:57:20 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv4Ck-0006xo-Sc for pgsql-admin@postgresql.org; Tue, 15 Jan 2013 10:57:18 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tv4Ch-0007Q6-MP for pgsql-admin@postgresql.org; Tue, 15 Jan 2013 10:57:18 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 7003E2856C; Tue, 15 Jan 2013 02:57:12 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (zcs-prod-ext-mta-1.vmware.com [10.113.62.223]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 6B7CDB02FD; Tue, 15 Jan 2013 02:57:12 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id 087F11219C6; Tue, 15 Jan 2013 02:59:22 -0800 (PST) X-Virus-Scanned: amavisd-new at zcs-prod-ext-mta-1.vmware.com Received: from zcs-prod-ext-mta-1.vmware.com ([127.0.0.1]) by localhost (zcs-prod-ext-mta-1.vmware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kO2kX0UtSSYf; Tue, 15 Jan 2013 02:59:21 -0800 (PST) Received: from zcs-prod-ext-mta-1.vmware.com (localhost.localdomain [127.0.0.1]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTP id C1D301219C5; Tue, 15 Jan 2013 02:59:21 -0800 (PST) Received: from [192.168.1.90] (unknown [10.113.62.14]) by zcs-prod-ext-mta-1.vmware.com (Postfix) with ESMTPSA; Tue, 15 Jan 2013 02:59:20 -0800 (PST) Message-ID: <50F53613.6000702@vmware.com> Date: Tue, 15 Jan 2013 12:57:23 +0200 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11 MIME-Version: 1.0 To: Lonni J Friedman CC: pgsql-admin@postgresql.org Subject: Re: corrupted indexes when using base backups generated from hot standby References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On 09.01.2013 20:28, Lonni J Friedman wrote: > Greetings, > I'm running postgres-9.2.2 in a Linux-x86_64 cluster with 1 master and > several hot standby servers. Since upgrading to 9.2.2 from 9.1.x a > few months ago, I switched from generating a base backup on the > master, to generating it on a dedicated slave/standby (to reduce the > load on the master). The command that I've always used to generate > the base backup is: > pg_basebackup -v -D /tmp/bb0 -x -Ft -U postgres > > However, I've noticed that whenever I use the base backup generated > from the standby to create a new standby server, many of the indexes > are corrupted. This was never the case when I was generating the > basebackup directly from the master. Now, I see errors similar to the > following when running queries against the tables that own the > indexes: > INDEX "debugger_2013_01_dacode_idx" contains unexpected zero page at block 12 > HINT: Please REINDEX it. > INDEX "smoke32on64tests_2013_01_suiteid_idx" contains unexpected zero > page at block 111 > HINT: Please REINDEX it. > > I've confirmed that the errors/corruption doesn't exist on the server > that is generating the base backup (I can run the same SQL query which > fails on the new standby, successfully). So it seems that I'm > potentially misunderstanding some part of the process. My setup > process is to simply untar the basebackup in the $PGDATA directory, > and copy over all the WAL logs into $PGDATA/pg_xlog. That process sounds correct. Since you're using pg_basebackup -x option, you don't even need to copy the WAL logs, although it shouldn't do any harm either . The tar file should contain everything needed to restore the backup. Can you provide more information? The log output would be nice. How large is the database? What kind of activity is there in the master while the backup is taken? - Heikki -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin