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 is...@postgresql.org 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

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-21 Thread Tom Lane
Itagaki Takahiro itagaki.takah...@gmail.com writes: On Fri, Jan 21, 2011 at 13:56, Tatsuo Ishii is...@postgresql.org 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

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 t...@sss.pgh.pa.us wrote: Itagaki Takahiro itagaki.takah...@gmail.com writes: On Fri, Jan 21, 2011 at 13:56, Tatsuo Ishii is...@postgresql.org wrote: Anyone has better idea? Tom dislikes my patch but I don't know how to deal with it. There was

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

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 the flag and if it's not set, it

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 the flag and if it's not set, it

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-02 Thread Tom Lane
Tatsuo Ishii is...@postgresql.org 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

Re: [HACKERS] How to know killed by pg_terminate_backend

2011-01-02 Thread Tatsuo Ishii
Tatsuo Ishii is...@postgresql.org 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

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 and if it's not set, it

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 is...@postgresql.org 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

Re: [HACKERS] How to know killed by pg_terminate_backend

2010-05-13 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

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 shared

[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