Re: Eliminating PD_ALL_VISIBLE, take 2

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: Eliminating PD_ALL_VISIBLE, take 2
Дата
Msg-id 51A70D46.8030909@vmware.com
обсуждение исходный текст
Ответ на Eliminating PD_ALL_VISIBLE, take 2  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: Eliminating PD_ALL_VISIBLE, take 2
Список pgsql-hackers
On 30.05.2013 06:54, Jeff Davis wrote:
> Continuation of:
>
> http://www.postgresql.org/message-id/1353551097.11440.128.camel@sussancws0025
>
> Rebased patch attached; no other changes.

> @@ -675,6 +675,16 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
>          }
>
>          /*
> +         * If this page is left over from an upgraded system, it may have a
> +         * PD_ALL_VISIBLE bit set (which is deprecated). If so, clear it.
> +         */
> +        if (PageIsAllVisible(page))
> +        {
> +            PageClearAllVisible(page);
> +            MarkBufferDirty(buf);
> +        }
> +
> +        /*
>           * Prune all HOT-update chains in this page.
>           *
>           * We count tuples removed by the pruning step as removed by VACUUM.

That could cause a torn page and checksum failure if checksums are 
enabled. Actually, I think the later PageClearAllVisible() call later in 
the function has the same problem, even without this patch.

Instead of adding a new vmbuffer argument to heap_insert() and friends, 
could we put that into BulkInsertStateData? The new argument is similar 
to the current bulk-insert state in spirit. That would simplify the 
callers and make the heapam API cleaner.

- Heikki



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: units in postgresql.conf comments
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: units in postgresql.conf comments