Re: Could not open file "pg_clog/...."

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Could not open file "pg_clog/...."
Дата
Msg-id 20090512185144.GI4050@alvh.no-ip.org
обсуждение исходный текст
Ответ на Could not open file "pg_clog/...."  ("Markus Wollny" <Markus.Wollny@computec.de>)
Ответы Re: Could not open file "pg_clog/...."  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Markus Wollny wrote:

> magazine=# vacuum analyze pcaction.article;
> PANIC:  corrupted item pointer: 5
> server closed the connection unexpectedly
>         This probably means the server terminated abnormally
>         before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.

This error comes from this piece of PageRepairFragmentation:

        /* Need to compact the page the hard way */
        itemidbase = (itemIdSort) palloc(sizeof(itemIdSortData) * nstorage);
        itemidptr = itemidbase;
        totallen = 0;
        for (i = 0; i < nline; i++)
        {
            lp = PageGetItemId(page, i + 1);
            if (ItemIdHasStorage(lp))
            {
                itemidptr->offsetindex = i;
                itemidptr->itemoff = ItemIdGetOffset(lp);
                if (itemidptr->itemoff < (int) pd_upper ||
                    itemidptr->itemoff >= (int) pd_special)
                    ereport(ERROR,
                            (errcode(ERRCODE_DATA_CORRUPTED),
                             errmsg("corrupted item pointer: %u",
                                    itemidptr->itemoff)));
                itemidptr->alignedlen = MAXALIGN(ItemIdGetLength(lp));
                totallen += itemidptr->alignedlen;
                itemidptr++;
            }
       }

What it means, AFAICT is that the page is corrupted beyond recovery.  If you
want to salvage the rest of the data on the table, you could zero out this
page, for which you'll obviously need to know what page it was.  It's not a
trivial patch to add that info to the error message, because
PageRepairFragmentation does not receive it.

I think it is worth our trouble to report block numbers on this kind of errors;
and in fact I had started on a patch to add errcontext() to vacuum and analyze
calls, but never finished it.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: "Francisco Figueiredo Jr."
Дата:
Сообщение: Re: Difference between "in (...)" and "= any(...)" queries when using arrays
Следующее
От: "WP Perquin"
Дата:
Сообщение: Re: regexp_matches problem