Re: [HACKERS] BUG #4961: pg_standby.exe crashes with no args

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>, pgsql-bugs(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-10 20:48:43
Message-ID: 9837222c0908101348y160d926eh7ef0e408b937ccc0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Mon, Aug 10, 2009 at 20:44, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>> If I just move those two lines into the #ifndef WIN32 block just
>> around it, it compiles and doesn't crash on running-with-no-arguments.
>> I haven't tried to actually use it though - can someone confirm if
>> this will actually make pg_standby not work properly?
>
> It would mean there's no way to trigger failover via signal.
>
> I think what we need is for pg_ctl to be able to send these signals...

Those signals don't *exist* on Windows. The whole idea of
cross-process signals don't *exist* on Windows.

We emulate it in the main backend, by creating a background thread
that sets a global variable. That is then polled in the
CHECK_FOR_INTERRUPTS macro. pg_ctl is perfectly capable of sending
these signals, but pg_standby can't receive them.

We could implement the same type of check in pg_standby, but it
requires something like CHECK_FOR_INTERRUPTS. And these interrupts
won't, by default, cause any kind of interruption of the process. In
the backend, we interrupt socket calls because we have the socket
wrapper layer, and nothing else. I don't know how doable this would be
in pg_standby - does it always block on a single thing where we could
stick some win32 synchronization code? If it's a single, or limited,
places we could implement something similar to the backend. But if we
need to interrupt at arbitrary locations, that's just not possible.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2009-08-10 21:44:17 Re: Huge speed penalty using <>TRUE instead of =FALSE
Previous Message Tom Lane 2009-08-10 18:44:48 Re: [HACKERS] BUG #4961: pg_standby.exe crashes with no args

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2009-08-10 20:56:08 Re: Patch for 8.5, transformationHook
Previous Message Tom Lane 2009-08-10 20:31:55 Re: pgsql: Refactor NUM_cache_remove calls in error report path to a PG_TRY