Re: CLUSTER patch - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: CLUSTER patch
Date
Msg-id 200207141754.g6EHsAN13717@candle.pha.pa.us
Whole thread Raw
In response to Re: CLUSTER patch  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: CLUSTER patch
List pgsql-patches
Tom Lane wrote:
> > 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.

Yes, I had one intermediate patch where I was calling
RelationClearRelation directly and not using the reload flag computed by
RelationForgetRelation.  Then I found RelationFlushRelation and that
seemed to work better.

This case is actually more complicated because after the swap, pg_class
still says thisxactonly but the relfilenode points to non-thisactonly
buffers, and via versa.  One of the key things is that thisxactonly
relations can't be forgotten because there are local buffers associated
with the relation, or something like that.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania
19026

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: CLUSTER patch
Next
From: Tom Lane
Date:
Subject: Re: CLUSTER patch