On Fri, Dec 7, 2012 at 10:33 PM, Simon Riggs <si...@2ndquadrant.com> wrote:

> On 7 December 2012 12:37, Michael Paquier <michael.paqu...@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

Reply via email to