I am thinking it would be useful for debugging if elog(PANIC) were to
exit by calling abort() so that a core dump would be produced.

Going out via proc_exit(), as it now does, seems like a bad idea in any
case, since that will try to do a bunch of cleanup activity that's
probably inappropriate after a panic.

Comments?

			regards, tom lane

Thu, 31 Oct 2002 11:50:46 -0500
Tom Lane <tgl@sss.pgh.pa.us>
elog(PANIC) should abort()?
Tom Lane wrote:
> I am thinking it would be useful for debugging if elog(PANIC) were to
> exit by calling abort() so that a core dump would be produced.
> 
> Going out via proc_exit(), as it now does, seems like a bad idea in any
> case, since that will try to do a bunch of cleanup activity that's
> probably inappropriate after a panic.

Sure, dump core.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Fri, 1 Nov 2002 22:28:36 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: elog(PANIC) should abort()?
Tom Lane writes:

> I am thinking it would be useful for debugging if elog(PANIC) were to
> exit by calling abort() so that a core dump would be produced.
>
> Going out via proc_exit(), as it now does, seems like a bad idea in any
> case, since that will try to do a bunch of cleanup activity that's
> probably inappropriate after a panic.

But is this appropriate?

PANIC:  The database cluster was initialized with CATALOG_VERSION_NO 200210181,
        but the backend was compiled with CATALOG_VERSION_NO 200211021.
        It looks like you need to initdb.
Aborted (core dumped)

-- 
Peter Eisentraut   peter_e@gmx.net


Tue, 26 Nov 2002 19:50:51 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: elog(PANIC) should abort()?
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> I am thinking it would be useful for debugging if elog(PANIC) were to
>> exit by calling abort() so that a core dump would be produced.

> But is this appropriate?

> PANIC:  The database cluster was initialized with CATALOG_VERSION_NO 200210181,
>         but the backend was compiled with CATALOG_VERSION_NO 200211021.
>         It looks like you need to initdb.
> Aborted (core dumped)

Hm.  We could possibly reduce those particular messages to FATAL.

OTOH, it's not unreasonable that seeing those messages *in the field*
might be an appropriate situation for a core dump.  I think as
developers we sometimes have a skewed sense of what's common ;-)

Ever since Bruce introduced the additional elog levels, I have felt it
would be a good idea to go through all the elog calls and re-evaluate
what levels they should have.  It's a lot o' work though...

			regards, tom lane

Tue, 26 Nov 2002 20:39:56 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: elog(PANIC) should abort()? 