Re: Corrupt indexes on slave when using pg_bulkload on master

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: James Cowell <jcowell(at)btinternet(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Corrupt indexes on slave when using pg_bulkload on master
Date: 2012-12-10 16:53:30
Message-ID: CAMkU=1wFBYqXr7ttaVtKRzkK=BbnzOfAEVeJcr5WxuG+rVbnsA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Dec 5, 2012 at 5:17 AM, James Cowell <jcowell(at)btinternet(dot)com> wrote:
> I'm using pg_bulkload to load large amounts of CSV data into a postgres
> database hourly.
>
> This database is replicated to a second node.
>
> Whenever a bulk load happens the indexes on the updated tables on the
> secondary node corrupt and are unusable until a reindex is run on the
> primary node. I get the error below on node 2:
>
> ERROR: index "tablename" contains unexpected zero page at block 0
> SQL state: XX002
> Hint: Please REINDEX it.
>
> I'm assuming that this is because of the way pg_bulkload builds the index on
> the primary, and possibly has something to do with the way pg_bulkload
> overwrites rows in the event of a constraint violation,

If there are no constraint violations, do you still see the problem?

> but at the same time
> if something works on the primary shouldn't the replicated node be able to
> process the WAL log?
>
> I've tried this on 9.1.6 and 9.1.5 on RHEL 6.3 with pg_bulkload build
> 3.1.1-1.pg91.rhel6 and it happens every time.

Were there any older version on which it worked? Can you post a
minimal schema and control file to reproduce the problem?

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2012-12-10 17:45:14 Re: Problem with aborting entire transactions on error
Previous Message Jeff Janes 2012-12-10 16:42:24 Re: Query and index ... unexpected result need advice.