Re: How to know killed by pg_terminate_backend

Поиск
Список
Период
Сортировка
От Tatsuo Ishii
Тема Re: How to know killed by pg_terminate_backend
Дата
Msg-id 20100515.220646.41634217.t-ishii@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: How to know killed by pg_terminate_backend  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: How to know killed by pg_terminate_backend  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Re: How to know killed by pg_terminate_backend  (Tatsuo Ishii <ishii@postgresql.org>)
Список pgsql-hackers
> >> 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 knows that the signal
> > has been sent by pg_terminate_backend(), not postmaster.
> 
> Or it could also be sent by some other user process, like the user
> running "kill" from the shell.

No problem (at least for pgpool-II).

If the flag is not set, postgres returns the same code as the one
killed by pg_terminate_backend(). The point is, backend is killed by
postmaster or not. Because if backend was killed by postmaster,
pgpool-II should not expect the PostgreSQL server is usable since
postmaster decided to shutdown.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: HS/SR Assert server crash