Re: ERROR: missing chunk number 0 for toast value

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Rushabh Lathia <rushabh(dot)lathia(at)enterprisedb(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: Re: ERROR: missing chunk number 0 for toast value
Date: 2014-01-02 21:15:46
Message-ID: 20140102211546.GB31635@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-01-02 16:05:09 -0500, Robert Haas wrote:
> On Thu, Jan 2, 2014 at 3:19 PM, Andres Freund <andres(at)2ndquadrant(dot)com> wrote:
> >> I was wondering if we could somehow arrange to not
> >> release the subtransaction's AccessShareLock on the table, as long as it
> >> was protecting toasted references someplace.
> >
> > Sounds fairly ugly...
>
> I think the only principled fixes are to either retain the lock or
> forcibly detoast before releasing it.

I don't think that's sufficient. Unless I miss something the problem
isn't restricted to TRUNCATE and such at all. I think a plain VACUUM
should be sufficient? I haven't tested it, but INSERT RETURNING
toasted_col a row, storing the result in a record, and then aborting the
subtransaction will allow the inserted row to be VACUUMed by a
concurrent transaction.
So I don't think anything along those lines will be sufficient.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-01-02 21:29:34 Re: INSERT...ON DUPLICATE KEY LOCK FOR UPDATE
Previous Message Robert Haas 2014-01-02 21:05:09 Re: ERROR: missing chunk number 0 for toast value