Re: Support for REINDEX CONCURRENTLY
От | Fujii Masao |
---|---|
Тема | Re: Support for REINDEX CONCURRENTLY |
Дата | |
Msg-id | CAHGQGwHWrKW4eXPSJUUOBEBEiz=bN9iWHm-5jCP_MdKW1bzwKA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Support for REINDEX CONCURRENTLY (Michael Paquier <michael.paquier@gmail.com>) |
Ответы |
Re: Support for REINDEX CONCURRENTLY
|
Список | pgsql-hackers |
On Tue, Jun 25, 2013 at 8:15 AM, Michael Paquier <michael.paquier@gmail.com> wrote: > Patch updated according to comments. Thanks for updating the patch! When I ran VACUUM FULL, I got the following error. ERROR: attempt to apply a mapping to unmapped relation 16404 STATEMENT: vacuum full; Could you let me clear why toast_save_datum needs to update even invalid toast index? It's required only for REINDEX CONCURRENTLY? @@ -1573,7 +1648,7 @@ toastid_valueid_exists(Oid toastrelid, Oid valueid) toastrel = heap_open(toastrelid, AccessShareLock); - result = toastrel_valueid_exists(toastrel, valueid); + result = toastrel_valueid_exists(toastrel, valueid, AccessShareLock); toastid_valueid_exists() is used only in toast_save_datum(). So we should use RowExclusiveLock here rather than AccessShareLock? + * toast_open_indexes + * + * Get an array of index relations associated to the given toast relation + * and return as well the position of the valid index used by the toast + * relation in this array. It is the responsability of the caller of this Typo: responsibility toast_open_indexes(Relation toastrel, + LOCKMODE lock, + Relation **toastidxs, + int *num_indexes) +{ + int i = 0; + int res = 0; + bool found = false; + List *indexlist; + ListCell *lc; + + /* Get index list of relation */ + indexlist = RelationGetIndexList(toastrel); What about adding the assertion which checks that the return value of RelationGetIndexList() is not NIL? When I ran pg_upgrade for the upgrade from 9.2 to HEAD (with patch), I got the following error. Without the patch, that succeeded. command: "/dav/reindex/bin/pg_dump" --host "/dav/reindex" --port 50432 --username "postgres" --schema-only --quote-all-identifiers --binary-upgrade --format=custom --file="pg_upgrade_dump_12270.custom" "postgres" >> "pg_upgrade_dump_12270.log" 2>&1 pg_dump: query returned 0 rows instead of one: SELECT c.reltoastrelid, t.indexrelid FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_index t ON (c.reltoastrelid = t.indrelid) WHERE c.oid = '16390'::pg_catalog.oid AND t.indisvalid; Regards, -- Fujii Masao
В списке pgsql-hackers по дате отправления: