Re: Support for REINDEX CONCURRENTLY

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Support for REINDEX CONCURRENTLY
Дата
Msg-id CAB7nPqTWGChpiHx0bBeA37dHGKTEgMn0MnMN2G0RRqpY6cw92A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support for REINDEX CONCURRENTLY  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers


On Fri, Dec 7, 2012 at 10:33 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
On 7 December 2012 12:37, Michael Paquier <michael.paquier@gmail.com> wrote:
> - There is still a problem with toast indexes. If the concurrent reindex of
> a toast index fails for a reason or another, pg_relation will finish with
> invalid toast index entries. I am still wondering about how to clean up
> that. Any ideas?

Build another toast index, rather than reindexing the existing one,
then just use the new oid.
Hum? The patch already does that. It creates concurrently a new index which is a duplicate of the existing one, then the old and new indexes are swapped. Finally the old index is dropped concurrently.

The problem I still see is the following one:
If a toast index, or a relation having a toast index, is being reindexed concurrently, and that the server crashes during the process, there will be invalid toast indexes in the server. If the crash happens before the swap, the new toast index is invalid. If the crash happens after the swap, the old toast index is invalid.
I am not sure the user is able to clean up such invalid toast indexes manually as they are not visible to him.
--
Michael Paquier
http://michael.otacoo.com

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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Commits 8de72b and 5457a1 (COPY FREEZE)
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Support for REINDEX CONCURRENTLY