Re: Incomplete freezing when truncating a relation during vacuum

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Incomplete freezing when truncating a relation during vacuum
Date: 2013-11-27 12:45:25
Message-ID: 5295E965.8020009@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/27/13 14:11, Andres Freund wrote:
> On 2013-11-27 13:56:58 +0200, Heikki Linnakangas wrote:
>>> Afaics the likelihood of the issue occuring on non-all-visible pages is
>>> pretty low, since they'd need to be skipped due to lock contention
>>> repeatedly.
>
>> Hmm. If a page has its visibility-map flag set, but contains a tuple that
>> appears to be dead because you've wrapped around, vacuum will give a
>> warning: "page containing dead tuples is marked as all-visible in relation
>> \"%s\" page %u".
>
> I don't think this warning is likely to be hit as the code stands -
> heap_page_prune() et. al. will have removed all dead tuples already,
> right and so has_dead_tuples won't be set.

It might be a good idea to add such a warning to heap_page_prune(). Or
also emit the warning in lazy_scan_heap() if heap_page_prune() returned > 0.

> Independent from this, ISTM we should add a
> else if (PageIsAllVisible(page) && all_visible)
> to those checks.

Can you elaborate, where should that be added?

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-11-27 13:14:53 Re: Incomplete freezing when truncating a relation during vacuum
Previous Message Pavel Stehule 2013-11-27 12:32:45 Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist