Re: BUG #13757: Able to write to postgres even when the main process has been killed - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #13757: Able to write to postgres even when the main process has been killed
Date
Msg-id 20151106164254.GB6104@alvherre.pgsql
Whole thread Raw
In response to BUG #13757: Able to write to postgres even when the main process has been killed  (vijaysam@mailworks.org)
List pgsql-bugs
vijaysam@mailworks.org wrote:

> But, when I try to kill -9 the master server main postgres process. The
> client code from java is able to continue to write to the postgres db which
> was the old master as there was a connection established to this server and
> the connection keeps allowing write to happen as thought the server is still
> running. I understand kill -9 is a bad thing.

Good thing that you do.  Don't do it, as it's not a proper shutdown
procedure.  There are three documented signals with varying degrees of
shutdown immediacy: SIGTERM, SIGINT, SIGQUIT.  The postmaster process
will take action to terminate server processes as appropriate if you use
those signals.  SIGKILL is entirely inappropriate.  If you would like to
use SIGKILL, you need to send it to *all* postgres processes, which will
cause a shutdown very similar in nature to SIGQUIT.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

pgsql-bugs by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: BUG #13757: Able to write to postgres even when the main process has been killed
Next
From: Tom Lane
Date:
Subject: Re: BUG #13757: Able to write to postgres even when the main process has been killed