Hi,

On 2015-06-04 12:57:42 -0400, Robert Haas wrote:
> +     /*
> +      * Do we need an emergency autovacuum?  If we're not sure, assume yes.
> +      */
> +     return !oldestOffsetKnown ||
> +             (nextOffset - oldestOffset > MULTIXACT_MEMBER_SAFE_THRESHOLD);

I think without teaching autovac about those rules, this might just lead
to lots of autovac processes starting without knowing they should do
something? They know about autovacuum_multixact_freeze_age, but they
know neither about !oldestOffsetKnown nor, afaics, about pending offset
wraparounds?

> -static MultiXactOffset
> -find_multixact_start(MultiXactId multi)
> +static bool
> +find_multixact_start(MultiXactId multi, MultiXactOffset *result)
>  {
>       MultiXactOffset offset;
>       int                     pageno;
> @@ -2630,6 +2741,9 @@ find_multixact_start(MultiXactId multi)
>       pageno = MultiXactIdToOffsetPage(multi);
>       entryno = MultiXactIdToOffsetEntry(multi);
>  
> +     if (!SimpleLruDoesPhysicalPageExist(MultiXactOffsetCtl, pageno))
> +             return false;
> +
>       /* lock is acquired by SimpleLruReadPage_ReadOnly */
>       slotno = SimpleLruReadPage_ReadOnly(MultiXactOffsetCtl, pageno, multi);
>       offptr = (MultiXactOffset *) 
> MultiXactOffsetCtl->shared->page_buffer[slotno];
> @@ -2642,25 +2756,31 @@ find_multixact_start(MultiXactId multi)
>

I think it'd be a good idea to also return false in case of a
InvalidMultiXactId - that'll be returned if the page has been zeroed.


Andres


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to