Re: getting rid of freezing - Mailing list pgsql-hackers

From Andres Freund
Subject Re: getting rid of freezing
Date
Msg-id 20130523190329.GC29374@alap2.anarazel.de
Whole thread Raw
In response to getting rid of freezing  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: getting rid of freezing  (Hannu Krosing <hannu@krosing.net>)
List pgsql-hackers
On 2013-05-23 19:51:48 +0200, Andres Freund wrote:
> We currently need to make sure we scanned the whole relation and have
> frozen everything to have a sensible relfrozenxid for a relation.
> 
> So, what I propose instead is basically:
> 1) only vacuum non-all-visible pages, even when doing it for
>    anti-wraparound
> 2) When we can set all-visible guarantee that all tuples on the page are
>    fully hinted. During recovery do the same, so we don't need to log
>    all hint bits.
>    We can do this with only an exclusive lock on the buffer, we don't
>    need a cleanup lock.
> 3) When we cannot mark a page all-visible or we cannot get the cleanup
>    lock, remember the oldest xmin on that page. We could set all visible
>    in the former case, but we want the page to be cleaned up sometime
>    soonish.
> 4) If we can get the cleanup lock, purge dead tuples from the page and
>    the indexes, just as today. Set the page as all-visible.
> 
> That way we know that any page that is all-visible doesn't ever need to
> look at xmin/xmax since we are sure to have set all relevant hint
> bits.

Heikki noticed that I made quite the omission here which is that you
would need to mark tuples as all visible as well. I was thinking about
using HEAP_MOVED_OFF | HEAP_MOVED_IN as a hint for that.

Greetings,

Andres Freund

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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: WARNING : pgstat wait timeout - stats_temp_directory - postgres 9.1
Next
From: David Powers
Date:
Subject: Re: streaming replication, "frozen snapshot backup on it" and missing relfile (postgres 9.2.3 on xfs + LVM)