Re: Corrupt indexes on slave when using pg_bulkload on master

Поиск
Список
Период
Сортировка
От wd
Тема Re: Corrupt indexes on slave when using pg_bulkload on master
Дата
Msg-id CABexzmgbKSkDtrQyborJS8PbUQ7QqMp8EdEcSwjvTu7W-GxiUg@mail.gmail.com
обсуждение исходный текст
Ответ на Corrupt indexes on slave when using pg_bulkload on master  (James Cowell <jcowell@btinternet.com>)
Список pgsql-general
We encounter the same problem, and have to change to use copy command


On Wed, Dec 5, 2012 at 9:17 PM, James Cowell <jcowell@btinternet.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, 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.
 
Does anyone have any experience in this area or advice they could give?  If you can point out something stupid I'm doing that would be very welcome :)
 
Thanks,
 
James

В списке pgsql-general по дате отправления:

Предыдущее
От: seiliki@so-net.net.tw
Дата:
Сообщение: How to keep the last row of a data set?
Следующее
От: Emi Lu
Дата:
Сообщение: Re: JDBC to load UTF8@psql to latin1@mysql