Re: Known issue with Reindex-based corruption? - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Known issue with Reindex-based corruption?
Date
Msg-id 13088.1077818158@sss.pgh.pa.us
Whole thread Raw
In response to Re: Known issue with Reindex-based corruption?  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Known issue with Reindex-based corruption?
List pgsql-bugs
Josh Berkus <josh@agliodbs.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

pgsql-bugs by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Known issue with Reindex-based corruption?
Next
From: Josh Berkus
Date:
Subject: Re: Known issue with Reindex-based corruption?