Re: Support for REINDEX CONCURRENTLY

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>
Subject: Re: Support for REINDEX CONCURRENTLY
Date: 2013-07-01 00:31:18
Message-ID: CAB7nPqQnC3ex3Od-bj=-Y96wy2JPkMMz-3rq6aN+eytuPZ-6pA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Please find attached an updated version of the patch removing
reltoastidxid (with and w/o context diffs), patch fixing the vacuum
full issue. With this fix, all the comments are addressed.

On Fri, Jun 28, 2013 at 5:07 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Fri, Jun 28, 2013 at 4:52 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
>> On 2013-06-28 16:30:16 +0900, Michael Paquier wrote:
>>> > When I ran VACUUM FULL, I got the following error.
>>> >
>>> > ERROR: attempt to apply a mapping to unmapped relation 16404
>>> > STATEMENT: vacuum full;
>>> This can be reproduced when doing a vacuum full on pg_proc,
>>> pg_shdescription or pg_db_role_setting for example, or relations that
>>> have no relfilenode (mapped catalogs), and a toast relation. I still
>>> have no idea what is happening here but I am looking at it. As this
>>> patch removes reltoastidxid, could that removal have effect on the
>>> relation mapping of mapped catalogs? Does someone have an idea?
>>
>> I'd guess you broke "swap_toast_by_content" case in cluster.c? We cannot
>> change the oid of a mapped relation (including indexes) since pg_class
>> in other databases wouldn't get the news.
> Yeah, I thought that something was broken in swap_relation_files, but
> after comparing the code path taken by my code and master, and the
> different function calls I can't find any difference. I'm assuming
> that there is something wrong in tuptoaster.c in the fact of opening
> toast index relations in order to get the Oids to be swapped... But so
> far nothing I am just not sure...
The error was indeed in swap_relation_files, when trying to swap toast
indexes. The code path doing the toast index swap was taken not for
toast relations but for their parent relations, creating weird
behavior for mapped catalogs at relation cache level it seems.

Regards,
--
Michael

Attachment Content-Type Size
20130701_1_remove_reltoastidxid_v15.patch application/octet-stream 46.7 KB
20130701_1_remove_reltoastidxid_v15_context.patch application/octet-stream 61.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2013-07-01 00:44:09 Re: FILTER for aggregates [was Re: Department of Redundancy Department: makeNode(FuncCall) division]
Previous Message Greg Smith 2013-06-30 23:49:20 Re: fallocate / posix_fallocate for new WAL file creation (etc...)