Re: Concurrency bug with vacuum full (cluster) and toast

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Concurrency bug with vacuum full (cluster) and toast
Date: 2019-03-19 15:48:26
Message-ID: CA+TgmoZpZ4UqDkC=huuyPxdn28rpWLGX5_mnokNBF21i8Qk_4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 18, 2019 at 12:53 PM Alexander Korotkov
<a(dot)korotkov(at)postgrespro(dot)ru> wrote:
> I've discovered bug, when vacuum full fails with error, because it
> couldn't find toast chunks deleted by itself. That happens because
> cluster_rel() sets OldestXmin, but toast accesses gets snapshot later
> and independently. That causes heap_page_prune_opt() to clean chunks,
> which rebuild_relation() expects to exist. This bug very rarely
> happens on busy systems which actively update toast values. But I
> found way to reliably reproduce it using debugger.

Boy, I really feel like we've talked about this before. These are
somewhat-related discussions, but none of them are exactly the same
thing:

http://postgr.es/m/1335.1304187758@sss.pgh.pa.us
http://postgr.es/m/20362.1359747327@sss.pgh.pa.us
http://postgr.es/m/87in8nec96.fsf@news-spur.riddles.org.uk

I don't know whether we've actually talked about this precise problem
before and I just can't find the thread, or whether I'm confusing what
you've found here with some closely-related issue.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-03-19 15:51:50 Re: pg_upgrade version checking questions
Previous Message Chris Travers 2019-03-19 15:44:40 Re: [HACKERS] Custom compression methods