Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-21 Thread Robert Haas
On Fri, Jan 21, 2011 at 10:35 AM, Tom Lane wrote: > Itagaki Takahiro writes: >> On Fri, Jan 21, 2011 at 13:56, Tatsuo Ishii wrote: >>> Anyone has better idea? Tom dislikes my patch but I don't know how to >>> deal with it. > >> There was another design in the past discussion: >> One idea is post

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-21 Thread Tom Lane
Itagaki Takahiro writes: > On Fri, Jan 21, 2011 at 13:56, Tatsuo Ishii wrote: >> Anyone has better idea? Tom dislikes my patch but I don't know how to >> deal with it. > There was another design in the past discussion: > One idea is postmaster sets a flag in the shared memory area > indicating i

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-21 Thread Itagaki Takahiro
On Fri, Jan 21, 2011 at 13:56, Tatsuo Ishii wrote: >> Here is the patch to implement the feature. >> >> 1) pg_terminate_backend() sends SIGUSR1 signal rather than SIGTERM to >>    the target backend. >> 2) The infrastructure used for message passing is >>    storage/ipc/procsignal.c The new messag

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-20 Thread Tatsuo Ishii
> Here is the patch to implement the feature. > > 1) pg_terminate_backend() sends SIGUSR1 signal rather than SIGTERM to >the target backend. > 2) The infrastructure used for message passing is >storage/ipc/procsignal.c The new message type for ProcSignalReason >is "PROCSIG_TERMNINATE_B

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-02 Thread Tatsuo Ishii
> Tatsuo Ishii writes: >> Comments are welcome. > > This is a bad idea. It makes an already-poorly-tested code path > significantly more fragile, in return for nothing of value. Are you saying that procsignal.c is the already-poorly-tested one? If so, why? As for "value", I have already explai

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-02 Thread Tom Lane
Tatsuo Ishii writes: > Comments are welcome. This is a bad idea. It makes an already-poorly-tested code path significantly more fragile, in return for nothing of value. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make chan

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-02 Thread Tatsuo Ishii
>> >> Seems reasonable. Does the victim backend currently know why it has been >> >> killed? >> > >> > I don't think so. >> > >> > One idea is postmaster sets a flag in the shared memory area >> > indicating it rceived SIGTERM before forwarding the signal to >> > backends. >> > >> > Backend check t

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-02 Thread Tatsuo Ishii
>> >> Seems reasonable. Does the victim backend currently know why it has been >> >> killed? >> > >> > I don't think so. >> > >> > One idea is postmaster sets a flag in the shared memory area >> > indicating it rceived SIGTERM before forwarding the signal to >> > backends. >> > >> > Backend check t

Re: [HACKERS] How to know killed by pg_terminate_backend

2010-05-15 Thread Tatsuo Ishii
> >> Seems reasonable. Does the victim backend currently know why it has been > >> killed? > > > > I don't think so. > > > > One idea is postmaster sets a flag in the shared memory area > > indicating it rceived SIGTERM before forwarding the signal to > > backends. > > > > Backend check the flag an

Re: [HACKERS] How to know killed by pg_terminate_backend

2010-05-14 Thread Robert Haas
On Thu, May 13, 2010 at 8:20 PM, Tatsuo Ishii wrote: >> > Maybe we could make PostgreSQL a little bit smarter so that it returns >> > a different code than 57P01 when killed by pg_terminate_backend(). >> >> Seems reasonable. Does the victim backend currently know why it has been >> killed? > > I d

Re: [HACKERS] How to know killed by pg_terminate_backend

2010-05-13 Thread Tatsuo Ishii
> > Maybe we could make PostgreSQL a little bit smarter so that it returns > > a different code than 57P01 when killed by pg_terminate_backend(). > > Seems reasonable. Does the victim backend currently know why it has been > killed? I don't think so. One idea is postmaster sets a flag in the sha

Re: [HACKERS] How to know killed by pg_terminate_backend

2010-05-12 Thread Heikki Linnakangas
Tatsuo Ishii wrote: > If a backend killed by pg_terminate_backend(), the backend returns > 57P01 which is identical to the one when it's killed by postmaster. > > Problem is, pgpool-II needs to trigger failover if postmaster goes > down because apparently pgpool-II cannot use the PostgreSQL server

[HACKERS] How to know killed by pg_terminate_backend

2010-05-12 Thread Tatsuo Ishii
Hi, If a backend killed by pg_terminate_backend(), the backend returns 57P01 which is identical to the one when it's killed by postmaster. Problem is, pgpool-II needs to trigger failover if postmaster goes down because apparently pgpool-II cannot use the PostgreSQL server anymore. On the otherha