Re: reindexdb hangs

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:21:50
Message-ID: 20070825222150.GU31461@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Tom Lane wrote:
> "dx k9" <bitsandbytes88(at)hotmail(dot)com> writes:
> > [ stuck reindex ]
> > It turns out it was a temporary database and temporary table, that just
> > wasn't there maybe it thought it was there from some type of snapshot then
> > the next minute it was gone.
>
> 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.

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.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Attachment Content-Type Size
reindex-temp.patch text/x-diff 790 bytes

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2007-08-25 22:51:53 Re: reindexdb hangs
Previous Message Kenji Morishige 2007-08-24 22:05:22 Re: Warm-Backup configuration question

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-08-25 22:39:29 Re: [WIP PATCH] Lazily assign xids for toplevel Transactions
Previous Message Florian G. Pflug 2007-08-25 21:45:08 [WIP PATCH] Lazily assign xids for toplevel Transactions