Re: Incomplete freezing when truncating a relation during vacuum - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Incomplete freezing when truncating a relation during vacuum
Date
Msg-id 5295E965.8020009@vmware.com
Whole thread Raw
In response to Re: Incomplete freezing when truncating a relation during vacuum  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Incomplete freezing when truncating a relation during vacuum  (Andres Freund <andres@2ndquadrant.com>)
List 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



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Re: [BUGS] BUG #7873: pg_restore --clean tries to drop tables that don't exist
Next
From: Andres Freund
Date:
Subject: Re: Incomplete freezing when truncating a relation during vacuum