Re: CLUSTER patch - Mailing list pgsql-patches

From Tom Lane
Subject Re: CLUSTER patch
Date
Msg-id 19622.1026668253@sss.pgh.pa.us
Whole thread Raw
In response to Re: CLUSTER patch  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: CLUSTER patch
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> New patch attached.  Something like this is required or
> heap_drop/index_drop will fail because it can't find the relation cache
> entries for the relation.  Maybe the trick is to properly invalidate the
> relation caches when pg_class is updated.

They should be updated *automatically* --- otherwise CLUSTER is hardly
the only thing that will fail.

> This is particularly
> significant for thisxactonly relations.

Yes.  After thinking awhile I realize that the real problem is that we
are trying to swap between an existing relation (!rd_myxactonly) and
a new relation (rd_myxactonly).  Buffers for one live in the main
buffer pool, for the other in the local buffer pool.  There's also the
little matter of the local state inside relcache.c.  While the update
to pg_class should make the right things happen to relfilenode, it
doesn't do anything to cause a change in rd_myxactonly status.

Not sure what to do about this.  Will think more.

            regards, tom lane

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: CLUSTER patch
Next
From: Bruce Momjian
Date:
Subject: Re: CLUSTER patch