Re: BUG #13757: Able to write to postgres even when the main process has been killed

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: vijaysam(at)mailworks(dot)org
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13757: Able to write to postgres even when the main process has been killed
Date: 2015-11-06 16:42:54
Message-ID: 20151106164254.GB6104@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

vijaysam(at)mailworks(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2015-11-06 16:42:56 Re: Re: BUG #13685: Archiving while idle every archive_timeout with wal_level hot_standby
Previous Message Kevin Grittner 2015-11-06 16:31:59 Re: BUG #13757: Able to write to postgres even when the main process has been killed