Re: Known issue with Reindex-based corruption?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Known issue with Reindex-based corruption?
Date: 2004-02-26 17:55:58
Message-ID: 13088.1077818158@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Josh Berkus <josh(at)agliodbs(dot)com> writes:
> The basic symptoms are:
> 1) Machine stated scheduled REINDEX.
> 2) Unexpected power-out
> 3) On reboot, we have 2 different versions of the index file on disk,
> one with 0 bytes. Attempts to use the index (via SELECT) result in
> statement-fatal errors.

Hm. Unless the REINDEX actually *completed* before the power-out, it
should not have had any effect other than creation of an unreferenced
file. My guess is that the reindex did complete, and updated the
index's pg_class row to point at the new file, but for some reason only
the pg_class update got down to disk.

> I'm waiting on more data. For now, I was wondering whether there was
> a known issue with WAL recovery on indexes in 7.2.4. Neil thought
> there was.

That's a definite possibility. Before 7.4 we did not emit WAL records
for data written during index build. What we could have here is that
the transaction completed and synced to WAL, but none of the data-file
writes were sent to disk before power-out. On restart, WAL replay would
faithfully update the pg_class row, but the index file would still be
empty :-(

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Josh Berkus 2004-02-26 18:03:00 Re: Known issue with Reindex-based corruption?
Previous Message Josh Berkus 2004-02-26 17:40:03 Re: Known issue with Reindex-based corruption?