Re: Severity of elog(FATAL) should vary by process - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Severity of elog(FATAL) should vary by process
Date
Msg-id 20061121014646.GJ13555@alvh.no-ip.org
Whole thread Raw
In response to Severity of elog(FATAL) should vary by process  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: quick review
Next
From: Tom Lane
Date:
Subject: Re: Day and month name localization uses wrong locale category