Re: PANIC: heap_update_redo: no block - Mailing list pgsql-general

From Qingqing Zhou
Subject Re: PANIC: heap_update_redo: no block
Date
Msg-id dvqk7f$2980$1@news.hub.org
Whole thread Raw
In response to PANIC: heap_update_redo: no block  ("Alex bahdushka" <bahdushka@gmail.com>)
Responses Re: PANIC: heap_update_redo: no block  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Confused about a function returning SETOF
Next
From: Bruno Wolff III
Date:
Subject: Re: Postgresql won't run after upgrade to fc5