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

Lists: pgsql-bugspgsql-hackers
From: "" <wader2(at)jcom(dot)home(dot)ne(dot)jp>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-03 12:18:02
Message-ID: 200908031218.n73CI25P019288@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


The following bug has been logged online:

Bug reference: 4961
Logged by:
Email address: wader2(at)jcom(dot)home(dot)ne(dot)jp
PostgreSQL version: 8.4.0
Operating system: Windows XP/2000
Description: pg_standby.exe crashes with no args
Details:

also clashes when run with recovery.conf,
after logged message below.

could not restore file "00000001.history" from archive: return code
-1073741811


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: wader2(at)jcom(dot)home(dot)ne(dot)jp
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-04 01:31:48
Message-ID: 3f0b79eb0908031831u379b7539wcfa5e86a71831545@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Hi,

On Mon, Aug 3, 2009 at 9:18 PM, <wader2(at)jcom(dot)home(dot)ne(dot)jp> wrote:
> also clashes when run with recovery.conf,
> after logged message below.
>
> could not restore file "00000001.history" from archive: return code
> -1073741811

Does pg_standby (e.g., pg_standby.exe --version) succeed when you
execute it alone? If not, you might have failed the installation of it.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-04 13:26:35
Message-ID: 4A78370B.7060406@jcom.home.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

thx,

> Does pg_standby (e.g., pg_standby.exe --version) succeed when you

--version and --help are no problem.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-10 02:20:58
Message-ID: 200908100220.n7A2Kwx20504@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

wader2 wrote:
> thx,
>
> > Does pg_standby (e.g., pg_standby.exe --version) succeed when you
>
> --version and --help are no problem.

I can't reproduce a crash here on BSD:

$ pg_standby
pg_standby: not enough command-line arguments

Can you show us the command and the crash text?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-10 14:10:19
Message-ID: 4A802A4B.8040708@jcom.home.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Bruce Momjian wrote:
> I can't reproduce a crash here on BSD:
>
> $ pg_standby
> pg_standby: not enough command-line arguments
>
> Can you show us the command and the crash text?

I guess this occurs on only windows (Japanese envionment?).

C:\Program Files\PostgreSQL\8.4\bin>pg_standby.exe

results no text on command line, Windows error dialog.

AppName:pg_standby.exe AppVer:0.0.0.0 ModName:msvcr80.dll
ModVer:8.0.50727.762 Offset:000091ad


From: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>
To: "wader2" <wader2(at)jcom(dot)home(dot)ne(dot)jp>, <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-10 16:19:40
Message-ID: 6B091D4140774BCBBC7F7D8E288183F8@HIRO57887DE653
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Hi.

Yes, I also reproduce it. It is very strange......
==
Windows-XP Home Edition Version2002 Service Pack3(Japanese)
CPU N270 @ 1.60Ghz 1GB RAM
==

C:\Program Files\PostgreSQL\8.4\bin>pg_standby.exe --help
pg_standby allows PostgreSQL warm standby servers to be configured.

Usage:
<snip>

C:\Program Files\PostgreSQL\8.4\bin>pg_standby.exe
...crash...

However, MinGW+gcc returns a normal result.

$ pg_standby
pg_standby: not enough command-line arguments

I don't have the margin time which still investigates it.

Regards,
Hiroshi Saito

----- Original Message -----
From: "wader2" <wader2(at)jcom(dot)home(dot)ne(dot)jp>

> Bruce Momjian wrote:
>> I can't reproduce a crash here on BSD:
>>
>> $ pg_standby
>> pg_standby: not enough command-line arguments
>>
>> Can you show us the command and the crash text?
>
> I guess this occurs on only windows (Japanese envionment?).
>
> C:\Program Files\PostgreSQL\8.4\bin>pg_standby.exe
>
> results no text on command line, Windows error dialog.
>
> AppName:pg_standby.exe AppVer:0.0.0.0 ModName:msvcr80.dll
> ModVer:8.0.50727.762 Offset:000091ad
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>
Cc: pgsql-bugs(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-10 18:10:24
Message-ID: 9837222c0908101110n6dc607beq2651006205f79f22@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

On Mon, Aug 10, 2009 at 16:10, wader2<wader2(at)jcom(dot)home(dot)ne(dot)jp> wrote:
> Bruce Momjian wrote:
>>
>> I can't reproduce a crash here on BSD:
>>
>>        $ pg_standby
>>        pg_standby: not enough command-line arguments
>>
>> Can you show us the command and the crash text?
>
> I guess this occurs on only windows (Japanese envionment?).
>
> C:\Program Files\PostgreSQL\8.4\bin>pg_standby.exe
>
> results no text on command line, Windows error dialog.
>
> AppName:pg_standby.exe AppVer:0.0.0.0 ModName:msvcr80.dll
> ModVer:8.0.50727.762   Offset:000091ad

I have reproduced this. The problem is:
(void) signal(SIGUSR1, sighandler);
(void) signal(SIGINT, sighandler); /* deprecated, use SIGUSR1 */

None of these signals exist on WIN32. I think the only reason it
compiles at all is that we bring in *some* of our signals emulation
code, but certainly not all of it.

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?

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
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 18:44:48
Message-ID: 22408.1249929888@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

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...

regards, tom lane


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
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/


From: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-12 09:08:39
Message-ID: 4A828697.6080706@jcom.home.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

I can't compile nor read source, but can tell you that
pg_standby.exe in 8.3.7 works fine.

Magnus Hagander wrote:
> 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.
>
>


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: wader2 <wader2(at)jcom(dot)home(dot)ne(dot)jp>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-12 09:14:13
Message-ID: 9837222c0908120214h752fe1act8c31595f1e3221b9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Yeah, the patch I think breaks things isn't included in 8.3.7 - it
will be in 8.3.8 though...

//Magnus

On Wed, Aug 12, 2009 at 11:08, wader2<wader2(at)jcom(dot)home(dot)ne(dot)jp> wrote:
> I can't compile nor read source, but can tell you that
> pg_standby.exe in 8.3.7 works fine.
>
> Magnus Hagander wrote:
>>
>> 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/


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-12 17:08:32
Message-ID: 3f0b79eb0908121008i24a49f9cl1fe14c16d0e78c53@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Hi,

On Tue, Aug 11, 2009 at 3:10 AM, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
> I have reproduced this. The problem is:
>        (void) signal(SIGUSR1, sighandler);
>        (void) signal(SIGINT, sighandler);      /* deprecated, use SIGUSR1 */
>
>
> None of these signals exist on WIN32. I think the only reason it
> compiles at all is that we bring in *some* of our signals emulation
> code, but certainly not all of it.

SIGINT has been used in pg_standby for a while (e.g., v8.3.7). I wonder
why this problem arises only in v8.4.0.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-12 17:24:24
Message-ID: 9837222c0908121024u218b8eb2n4274e9038b22ce3d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

On Wed, Aug 12, 2009 at 19:08, Fujii Masao<masao(dot)fujii(at)gmail(dot)com> wrote:
> Hi,
>
> On Tue, Aug 11, 2009 at 3:10 AM, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
>> I have reproduced this. The problem is:
>>        (void) signal(SIGUSR1, sighandler);
>>        (void) signal(SIGINT, sighandler);      /* deprecated, use SIGUSR1 */
>>
>>
>> None of these signals exist on WIN32. I think the only reason it
>> compiles at all is that we bring in *some* of our signals emulation
>> code, but certainly not all of it.
>
> SIGINT has been used in pg_standby for a while (e.g., v8.3.7). I wonder
> why this problem arises only in v8.4.0.

Not sure. Potentially pure luck. SIGINT has never *worked*, though, it
just hasn't crashed.

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


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-19 06:38:35
Message-ID: 3f0b79eb0908182338r2dedc76g394ecf6a8eb2ba5b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Hi,

On Thu, Aug 13, 2009 at 2:24 AM, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
> Not sure. Potentially pure luck. SIGINT has never *worked*, though, it
> just hasn't crashed.

OK.

> 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.

I think that CHECK_FOR_INTERRUPTS should be placed just before
checking the flag 'signaled' which may be enabled by the signal handler.
Here is the pseudo-code.

--------------------
{
/* Check for trigger file or signal first */
CheckForExternalTrigger();
+ #ifdef WIN32
+ CHECK_FOR_INTERRUPTS();
+ #endif /* WIN32 */
if (signaled)
{
Failover = FastFailover;
--------------------

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-19 09:30:26
Message-ID: 9837222c0908190230l47ffdef7hbeb6c1c62fcf9c90@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

On Wed, Aug 19, 2009 at 08:38, Fujii Masao<masao(dot)fujii(at)gmail(dot)com> wrote:
> On Thu, Aug 13, 2009 at 2:24 AM, Magnus Hagander<magnus(at)hagander(dot)net> wrote:
>> Not sure. Potentially pure luck. SIGINT has never *worked*, though, it
>> just hasn't crashed.
>
> OK.
>
>> 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.
>
> I think that CHECK_FOR_INTERRUPTS should be placed just before
> checking the flag 'signaled' which may be enabled by the signal handler.
> Here is the pseudo-code.
>
> --------------------
>        {
>                /* Check for trigger file or signal first */
>                CheckForExternalTrigger();
> + #ifdef WIN32
> +               CHECK_FOR_INTERRUPTS();
> + #endif /* WIN32 */
>                if (signaled)
>                {
>                        Failover = FastFailover;
> --------------------

It's going to take a lot more than that, really. I looked a bit more
at it, and I think the best way is to do a win32 specific thing all
the way, not just emulate signals. Given that we only have a couple of
signal() calls anyway. I think that's going to be much clearer in what
it does, and also a lot simpler code in the end. The reason we have
the full emulation layer is that we use signals all over the place in
the backend.

From what I can tell, we don't actually need to interrupt anything
other than the sleep call on line 810, because we only check for the
signaled=true state in that loop anyway. Can someone more
knowledgeable in the pg_standby code comment on that?

This would amount to fairly major surgery for pg_standby on Win32. Is
that something we'd want to backpatch, or do we want to backpatch just
the removal of the signal() calls which would amount to not supporting
signals in pg_standby on win32?

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


From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-19 09:45:31
Message-ID: 4A8BC9BB.1010109@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Magnus Hagander wrote:
> This would amount to fairly major surgery for pg_standby on Win32. Is
> that something we'd want to backpatch, or do we want to backpatch just
> the removal of the signal() calls which would amount to not supporting
> signals in pg_standby on win32?

I think we should just remove the signals support for win32. The trigger
file method still works, and the signal method has always been a bit
iffy (it doesn't work when pg_standby isn't running, for example, which
happens between processing of each WAL file, because there's no process
to signal).

Is pg_standby killed correctly when postmaster dies?

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, 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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-08-19 19:56:50
Message-ID: 9837222c0908191256j24981969o6647b5abe3fd85ad@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

On Wed, Aug 19, 2009 at 11:45, Heikki
Linnakangas<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Magnus Hagander wrote:
>> This would amount to fairly major surgery for pg_standby on Win32. Is
>> that something we'd want to backpatch, or do we want to backpatch just
>> the removal of the signal() calls which would amount to not supporting
>> signals in pg_standby on win32?
>
> I think we should just remove the signals support for win32. The trigger
> file method still works, and the signal method has always been a bit
> iffy (it doesn't work when pg_standby isn't running, for example, which
> happens between processing of each WAL file, because there's no process
> to signal).

Fair enough.

> Is pg_standby killed correctly when postmaster dies?

No idea. I can set up and env to test, but I don't have one ready.
Anybody else have tried this?

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


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, 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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-11-04 10:40:19
Message-ID: 3f0b79eb0911040240y1c2316a5y7bd5e13115740847@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Hi,

Sorry for this late reply.

On Wed, Aug 19, 2009 at 6:45 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
> Is pg_standby killed correctly when postmaster dies?

No. In my test (v8.3.7 on Win), an immediate shutdown was able to
kill postmaster, but not pg_standby and the startup process.

Though we should change those to handle the shutdown signals
correctly, this change is not imperative need. At first, we should
just get rid of the signal support from pg_standby on Win, in order
to avoid the pg_standby crash. The attached is the patch to do so.
If this patch is OK, the backport is required for 8.3.x.

Thought?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment Content-Type Size
drop_signal_support_for_pgstandby_win32.patch text/x-patch 2.5 KB

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, 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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-11-04 12:53:34
Message-ID: 4AF1794E.8030909@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Fujii Masao wrote:
> On Wed, Aug 19, 2009 at 6:45 PM, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> Is pg_standby killed correctly when postmaster dies?
>
> No. In my test (v8.3.7 on Win), an immediate shutdown was able to
> kill postmaster, but not pg_standby and the startup process.

Hmm. We should do something about that.. Magnus?

> Though we should change those to handle the shutdown signals
> correctly, this change is not imperative need. At first, we should
> just get rid of the signal support from pg_standby on Win, in order
> to avoid the pg_standby crash. The attached is the patch to do so.
> If this patch is OK, the backport is required for 8.3.x.

Ok, committed to HEAD, 8.4 and 8.3.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com


From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, 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: BUG #4961: pg_standby.exe crashes with no args
Date: 2009-11-05 04:29:40
Message-ID: 3f0b79eb0911042029p55b94c99i15abeedf8089a652@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Hi,

On Wed, Nov 4, 2009 at 9:53 PM, Heikki Linnakangas
<heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> Though we should change those to handle the shutdown signals
>> correctly, this change is not imperative need. At first, we should
>> just get rid of the signal support from pg_standby on Win, in order
>> to avoid the pg_standby crash. The attached is the patch to do so.
>> If this patch is OK, the backport is required for 8.3.x.
>
> Ok, committed to HEAD, 8.4 and 8.3.

Thanks a lot!

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center