Re: [GENERAL] Shutting down a warm standby database in 8.2beta3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: "Stephen Harris" <lists(at)spuddy(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Shutting down a warm standby database in 8.2beta3
Date: 2006-11-20 16:40:31
Message-ID: 7456.1164040831@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Magnus Hagander" <mha(at)sollentuna(dot)net> writes:
> However, for this specific case we might be able to do something. pg_ctl
> creates a job object that it assigns the postmaster to when it's started
> if that works. (Won't work if pg_ctl itself is running inside a job
> object, but normally it won't be doing that). That means that we could
> have pg_ctl look up this job object and execute TerminateJobObject() on
> it. That will kill all processes inside the job object (includnig
> backends, but if we run it from pg_ctl *after* postmaster has shut down,
> there should be none of those left).

That would take care of cleaning up any scripts after the postmaster has
already quit, but what about the problem of kicking the waiting backend
off the system() call in the first place? I suppose that if we can hack
things so system() doesn't block SIGQUIT on Windows, it might be OK, at
least for the "-m immediate" case. I was hoping we could get Query
Cancel to SIGINT a system()-invoked script in a regular backend, but
that might be too much to hope for on Windows, especially if it hasn't
even got a distinction between INT and QUIT ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2006-11-20 16:41:01 Re: Eliminating bad characters from a database for upgrading from 7.4 to 8.1
Previous Message Richard Broersma Jr 2006-11-20 16:35:51 Re: Eliminating bad characters from a database for upgrading from 7.4 to 8.1

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2006-11-20 16:41:43 Re: Transaction start in pg_stat_activity
Previous Message Magnus Hagander 2006-11-20 16:34:44 Re: [GENERAL] Shutting down a warm standby database in 8.2beta3