Re: PANIC: heap_update_redo: no block

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: PANIC: heap_update_redo: no block
Дата
Msg-id dvqk7f$2980$1@news.hub.org
обсуждение исходный текст
Ответ на PANIC: heap_update_redo: no block  ("Alex bahdushka" <bahdushka@gmail.com>)
Ответы Re: PANIC: heap_update_redo: no block  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
"Tom Lane" <tgl@sss.pgh.pa.us> wrote
> "Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> > BTW: I just realized that there is another (better) way to do so is to
> > enable WAL_DEBUG in xlog.h and SET XLOG_DEBUG=true. And that's why we
don't
> > have much error message in xlog redo.
>
> That was probably Vadim's original reasoning for not being very verbose
> in the redo routines' various PANIC messages.  But for failures in the
> field it'd be awfully nice to be able to see this info from a standard
> build, so I'm thinking we should improve the elog messages.  If you feel
> like creating a patch I'll be glad to apply it ...
>

So there are three ways to do it:
(1) enable WALD_DEBUG by default
So it is user's reponsibility to enable XLOG_DEBUG to print verbose
information while at error. This adds no cost during normal running, but the
problem is that too much information (only the last is useful) may pollute
the log file.

(2) print verbose information after errror
We can change StartupXLOG like this:

PG_TRY();
{
    RmgrTable[record->xl_rmid].rm_redo(EndRecPtr, record);
}
PG_CATCH();
{
    RmgrTable[record->xl_rmid].rm_desc(buf,
         record->xl_info, XLogRecGetData(record));
    abort();
}
PG_END_CATCH();

Also, channge err_finish() so that if PANIC if InRecovery, do a
PG_RE_THROW(). The problem is this looks like a little bit hack.

(3) Replace elog in every xlog_ABC_redo() to some xlog_elog(), so the
description information can be automatically appended.

I vote for method 2.

Regards,
Qingqing



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Confused about a function returning SETOF
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Postgresql won't run after upgrade to fc5