CLUSTER doesn't check indisvalid etc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: CLUSTER doesn't check indisvalid etc
Date: 2007-09-29 15:41:39
Message-ID: 4003.1191080499@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It strikes me that CLUSTER has been broken since CREATE INDEX
CONCURRENTLY was put in, because it doesn't check whether the index
it's been asked to cluster on is valid. If C.I.C. fails before marking
the index indisvalid, a subsequent CLUSTER would happily cluster using
only the index entries that are present, thereby losing data.

Fixing this in 8.2 seems a simple matter of checking indisvalid.
However I'm not quite sure what to do in HEAD: is it important to
honor indcheckxmin? Offhand it seems the worst problem we could
have with a not-quite-ready index is that some recently dead tuples
might be scanned out-of-order because they'd be visited via a broken
HOT chain; and we need not worry too much about whether CLUSTER
preserves exact index ordering for such tuples.

Are there any other utility commands besides CLUSTER that should be
checking index validity? I don't see anything in a quick look, but
maybe I missed something.

Comments?

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-09-29 15:42:40 Re: PGBuildfarm member skylark Branch HEAD Failed at Stage Make
Previous Message Gregory Stark 2007-09-29 15:20:30 Re: Something's been bugging me