Skip site navigation (1) Skip section navigation (2)

Re: reindexdb hangs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: dx k9 <bitsandbytes88(at)hotmail(dot)com>, pgsql-admin(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: reindexdb hangs
Date: 2007-08-25 22:51:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-adminpgsql-hackers
Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Tom Lane wrote:
>> Hmm, there is not any filter in ReindexDatabase() to exclude temp tables
>> of other backends, but it sure seems like there needs to be.  CLUSTER
>> might have the same issue.  I think we fixed this in VACUUM long ago,
>> but we need to check the other commands that grovel over all of a database.

> Was this ever fixed?  I think it wasn't, because I don't see any check
> in ReindexDatabase.  Here is a patch to add one.

No, that's still on the todo list.  Your patch looks reasonable.

> I examined cluster.c and it does seem to be missing a check too.  I'm
> not sure where to add one though; the best choice would be the place
> where the list of rels is built, but that scans only pg_index, so it
> doesn't have access to the namespace of each rel.  So one idea would be
> to get the pg_class row for each candidate, but that seems slow.
> Another idea would be to just add all the candidates and silently skip
> the temp indexes in cluster_rel.

Yeah, an extra fetch of the pg_class row doesn't seem all that nice.
I think you'd want to check it in approximately the same two places
where pg_class_ownercheck() is applied (one for the 1-xact and one for
the multi-xact path).

Are there any other commands to be worried about?  I can't see any
besides VACUUM/ANALYZE, and those seem covered.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Florian G. PflugDate: 2007-08-25 23:50:53
Subject: Re: [WIP PATCH] Lazily assign xids for toplevel Transactions
Previous:From: Tom LaneDate: 2007-08-25 22:39:29
Subject: Re: [WIP PATCH] Lazily assign xids for toplevel Transactions

pgsql-admin by date

Next:From: feng xinguoDate: 2007-08-27 08:17:07
Subject: use copy command!
Previous:From: Alvaro HerreraDate: 2007-08-25 22:21:50
Subject: Re: reindexdb hangs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group