Re: Why we panic in pglz_decompress

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Why we panic in pglz_decompress
Дата
Msg-id 2303.1204300329@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Why we panic in pglz_decompress  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Why we panic in pglz_decompress  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Zdenek Kotala wrote:
>> I'm now looking into toast code and I found following code in  
>> pglz_decompress:
>> 
>> 00704     if (destsize != source->rawsize)
>> 00705         elog(destsize > source->rawsize ? FATAL : ERROR,
>> 00706              "compressed data is corrupt");
>> 
>> 
>> I'm surprise why we there panic?

> Agreed, FATAL is too strong.

Did either of you read the comment just before this code?  The reason
it's panicing is that it's possibly already tromped on some critical
data structure inside the backend.

>> My idea is to improve this piece of code and move error logging to  
>> callers (heap_tuple_untoast_attr() and heap_tuple_untoast_attr_slice())  
>> where we have a little bit more details (especially for external 
>> storage).

> Why move it?  Just adding errcontext in the callers should be enough.

AFAIR this error has never once been reported from the field, so I don't
see the point of investing a lot of effort in it.
        regards, tom lane


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

Предыдущее
От: Zdenek Kotala
Дата:
Сообщение: Re: Why we panic in pglz_decompress
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Read-ahead and parallelism in redo recovery