Re: Broken HOT chains in system catalogs

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Re: Broken HOT chains in system catalogs
Дата
Msg-id 20110416164808.GA25433@tornado.leadboat.com
обсуждение исходный текст
Ответ на Re: Broken HOT chains in system catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Broken HOT chains in system catalogs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Apr 16, 2011 at 11:17:53AM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > On Fri, Apr 15, 2011 at 03:01:04PM -0400, Tom Lane wrote:
> >> What is happening is that the preceding "reindex table pg_index" set the
> >> indcheckxmin flag for pg_index's indexes.  The new table built by vacuum
> >> full contains no HOT chains at all, let alone broken ones, so at the end
> >> of reindex_index we decide we ought to clear the indcheckxmin flag.
> >> But we are not done swapping the old and new indexes, so the uniqueness
> >> check doesn't work right --- I believe it's looking into the old index
> >> and finding a TID that means something totally different in the new
> >> table.
> 
> > For that matter, I believe it's also attempting to insert into the old index.
> 
> I wondered about that, but it seemed to me that if that happened, it
> ought to have much more visible symptoms --- ie, the committed row would
> not be findable through the new index.  The typical case according to my
> testing was that the unique check wouldn't fail, so we should have been
> hearing reports of pg_index searches failing post-VACUUM, and we
> weren't.  I did not expend the time to trace it down in detail, though,
> once I'd gotten the general picture of what was happening.

I'm not 100% sure, either.

> > I think we're safe _consulting_ the system catalogs, since systable_beginscan
> > notes that case and does not use obsolete indexes.  Any other system catalog
> > _updates_ are potentially risky, though.  Perhaps index_insert() and friends
> > should assert that the index is not pending rebuild?
> 
> [ squint... ] Won't that result in the rebuild failing outright?  We
> can't remove an index from the pending list till after it's rebuilt,
> for obvious reasons.

That would be a problem if an ambuild function were to call back through the
indexam.c layer to add an individual entry.  No core access method does that,
and there's nothing I can see to recommend doing it.

nm


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Bizarre reindex_relation API
Следующее
От: Leonardo Francalanci
Дата:
Сообщение: Re: switch UNLOGGED to LOGGED