"Tom Lane" <tgl@xxxxxxxxxxxxx> wrote > "Qingqing Zhou" <zhouqq@xxxxxxxxxxxxxx> 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