Re: Severity of elog(FATAL) should vary by process

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Severity of elog(FATAL) should vary by process
Date: 2006-11-21 01:46:46
Message-ID: 20061121014646.GJ13555@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

> Rather than try to change a lot of elog call sites, what I'm thinking
> would be a good plan is to make the FATAL-exit case in elog.c always
> exit with exit(1) (right now it tests a couple of different conditions
> to decide what to return). Then, in the postmaster, consider an exit
> code of 1 to be either OK or not OK depending on which child it came
> from. I think there are a small number of exit(1) calls that might
> need to be changed to exit(2) because they are trying to force the
> postmaster to do a panic restart, but it should be a minimal patch.

I was going to suggest using symbolic names to exit codes instead of
hardcoding 1 or 2. We do that in Mammoth replicator, and use the exit
codes to determine whether the postmaster needs to take special action
for different replication scenarios, e.g. when one needs to promote a
master server to slave or vice versa.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Dunstan 2006-11-21 02:11:33 Re: Custom Data Type Question
Previous Message Tom Lane 2006-11-21 01:30:37 Re: Day and month name localization uses wrong locale category