|
Home > Archive > Slony1 PostgreSQL Replication > August 2005 > [PATCH] slon win32
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[PATCH] slon win32
|
|
| Magnus Hagander 2005-07-17, 11:23 am |
| Hi!
Here is a first rough patch for slon to run on win32. It does enough so
that I can replicate back and forth between my linux and win32 boxes.
There are a lot of thigns still to do - there is no service integratino
(though the code expects it..), no eventlog etc. but it's a start, and I
figured I should get it out there for people to comment on and possibly
apply so it won't conflict with others...
Changes:
* Added "override" to LDFLAGS in the Makefile. I am no makefile guru, so
I don't really know why :-) But it was there for CFLAGS, and without it,
the pthreads library simply wasn't added to the build command...
* For win32 only, added mandatory link to "wsock32" winsock functions,
required so we can access TCP/IP functions at all.
* #ifdef out the whole "watchdog process" for win32. Win32 does not have
signals, so we don't need a special process to catch and channel those.
And we expect the service control manager to deal with restarts as
required (when it comes).
* As a consequence of win32 not having signals, change exits to just do
exit() instead of sigterm:ing the own process. This includes modifying
slon_abort() and slon_restart() (_restart seems never to be used?)
* Import pgpipe implementation from postgresql backend, and change all
read/write to piperead/pipewrite - same as in the pg backend. This is
rquired because on win32 you can't "select()" on a pipe. The pgpipe
implementation uses TCP sockets instead.
* Remove teh sched_shutdown() code per my previous mail. Not strictly a
part of the win32 work...
Those are the main changes.
pipe.c goes in src/slon/. It's a direct import from postgresql with the
only change being the replacement of ereport with slon_log.
//Magnus
| |
| Dave Page 2005-07-18, 3:23 am |
| If there are no objections I will apply this patch within the next day
or so.
Regards, Dave. =20
> -----Original Message-----
> From: slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org=20
> [mailto:slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org] On=20
> Behalf Of Magnus Hagander
> Sent: 17 July 2005 16:06
> To: slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> Subject: [Slony1-general] [PATCH] slon win32
>=20
> Hi!
>=20
> Here is a first rough patch for slon to run on win32. It does=20
> enough so
> that I can replicate back and forth between my linux and win32 boxes.
> There are a lot of thigns still to do - there is no service=20
> integratino
> (though the code expects it..), no eventlog etc. but it's a=20
> start, and I
> figured I should get it out there for people to comment on=20
> and possibly
> apply so it won't conflict with others...
>=20
> Changes:
> * Added "override" to LDFLAGS in the Makefile. I am no=20
> makefile guru, so
> I don't really know why :-) But it was there for CFLAGS, and=20
> without it,
> the pthreads library simply wasn't added to the build command...
>=20
> * For win32 only, added mandatory link to "wsock32" winsock functions,
> required so we can access TCP/IP functions at all.
>=20
> * #ifdef out the whole "watchdog process" for win32. Win32=20
> does not have
> signals, so we don't need a special process to catch and=20
> channel those.
> And we expect the service control manager to deal with restarts as
> required (when it comes).
>=20
> * As a consequence of win32 not having signals, change exits=20
> to just do
> exit() instead of sigterm:ing the own process. This includes modifying
> slon_abort() and slon_restart() (_restart seems never to be used?)
>=20
> * Import pgpipe implementation from postgresql backend, and change all
> read/write to piperead/pipewrite - same as in the pg backend. This is
> rquired because on win32 you can't "select()" on a pipe. The pgpipe
> implementation uses TCP sockets instead.
>=20
> * Remove teh sched_shutdown() code per my previous mail. Not=20
> strictly a
> part of the win32 work...
>=20
>=20
>=20
> Those are the main changes.
>=20
> pipe.c goes in src/slon/. It's a direct import from=20
> postgresql with the
> only change being the replacement of ereport with slon_log.
>=20
> //Magnus
>=20
>=20
| |
| Darcy Buskermolen 2005-07-18, 1:24 pm |
| On Monday 18 July 2005 00:06, Dave Page wrote:
> If there are no objections I will apply this patch within the next day
> or so.
My only comment re this patch is, I think we had discuses putting the OS
specific stuff (pipe.c) in it's own directory ie src/port, following the PG
convention.
>
> Regards, Dave.
>
>
> ____________________
____________________
_______
> Slony1-general mailing list
> Slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> http://gborg.postgresql.org/mailman.../slony1-general
--
Darcy Buskermolen
Wavefire Technologies Corp.
http://www.wavefire.com
ph: 250.717.0200
fx: 250.763.1759
| |
| Dave Page 2005-07-18, 8:24 pm |
| =20
> -----Original Message-----
> From: Darcy Buskermolen [mailto:darcy- QSklyHmfoqpWk0Htik3J
/w@public.gmane.org]=20
> Sent: 18 July 2005 19:23
> To: slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> Cc: Dave Page; Magnus Hagander
> Subject: Re: [Slony1-general] [PATCH] slon win32
>=20
> On Monday 18 July 2005 00:06, Dave Page wrote:
> the next day
>=20
> My only comment re this patch is, I think we had discuses=20
> putting the OS=20
> specific stuff (pipe.c) in it's own directory ie src/port,=20
> following the PG=20
> convention.
Yes, I remember that discussion. I'll adjust the patch accordingly
before committing.
Regards, Dave.
| |
| Dave Page 2005-07-18, 8:24 pm |
|
> -----Original Message-----
> From: slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> [mailto:slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org] On
> Behalf Of Dave Page
> Sent: 18 July 2005 20:28
> To: Darcy Buskermolen; slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> Subject: RE: [Slony1-general] [PATCH] slon win32
>
>
> Yes, I remember that discussion. I'll adjust the patch accordingly
> before committing.
I've been looking at this, and it actually becomes quite messy for what
is almost certainly going to be a pretty small amount of port specific
code. It seems to me that a much cleaner way is to simply include a
slon/port directory, and include the port specific stuff there (per PGs
src/backend/port directory). The attached version of Magnus' patch does
exactly that, with port/pipe.c built directly from slon/Makefile.
Any thoughts/objections?
Regards, Dave.
| |
| Darcy Buskermolen 2005-07-18, 8:24 pm |
| On Monday 18 July 2005 14:42, Dave Page wrote:
>
> I've been looking at this, and it actually becomes quite messy for what
> is almost certainly going to be a pretty small amount of port specific
> code. It seems to me that a much cleaner way is to simply include a
> slon/port directory, and include the port specific stuff there (per PGs
> src/backend/port directory). The attached version of Magnus' patch does
> exactly that, with port/pipe.c built directly from slon/Makefile.
>
> Any thoughts/objections?
That's fine in my books.
>
> Regards, Dave.
--
Darcy Buskermolen
Wavefire Technologies Corp.
http://www.wavefire.com
ph: 250.717.0200
fx: 250.763.1759
| |
| Dave Page 2005-07-20, 9:24 am |
| Patch applied with port directory added as discussed, and a couple of
minor fixes.
Slony will now work out of the box on Windows, albeit currently lacking
service code and proper event logging. :-)
(Also tested on Linux prior to commit - all seems OK).
Regards, Dave
> -----Original Message-----
> From: slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org=20
> [mailto:slony1-general-bounces- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org] On=20
> Behalf Of Magnus Hagander
> Sent: 17 July 2005 16:06
> To: slony1-general- AuKwsB3Fm+ugFIWk8tvy
RWD2FQJk+8+b@public.gmane.org
> Subject: [Slony1-general] [PATCH] slon win32
>=20
> Hi!
>=20
> Here is a first rough patch for slon to run on win32. It does=20
> enough so
> that I can replicate back and forth between my linux and win32 boxes.
> There are a lot of thigns still to do - there is no service=20
> integratino
> (though the code expects it..), no eventlog etc. but it's a=20
> start, and I
> figured I should get it out there for people to comment on=20
> and possibly
> apply so it won't conflict with others...
>=20
> Changes:
> * Added "override" to LDFLAGS in the Makefile. I am no=20
> makefile guru, so
> I don't really know why :-) But it was there for CFLAGS, and=20
> without it,
> the pthreads library simply wasn't added to the build command...
>=20
> * For win32 only, added mandatory link to "wsock32" winsock functions,
> required so we can access TCP/IP functions at all.
>=20
> * #ifdef out the whole "watchdog process" for win32. Win32=20
> does not have
> signals, so we don't need a special process to catch and=20
> channel those.
> And we expect the service control manager to deal with restarts as
> required (when it comes).
>=20
> * As a consequence of win32 not having signals, change exits=20
> to just do
> exit() instead of sigterm:ing the own process. This includes modifying
> slon_abort() and slon_restart() (_restart seems never to be used?)
>=20
> * Import pgpipe implementation from postgresql backend, and change all
> read/write to piperead/pipewrite - same as in the pg backend. This is
> rquired because on win32 you can't "select()" on a pipe. The pgpipe
> implementation uses TCP sockets instead.
>=20
> * Remove teh sched_shutdown() code per my previous mail. Not=20
> strictly a
> part of the win32 work...
>=20
>=20
>=20
> Those are the main changes.
>=20
> pipe.c goes in src/slon/. It's a direct import from=20
> postgresql with the
> only change being the replacement of ereport with slon_log.
>=20
> //Magnus
>=20
>=20
| |
| Stefan Kaltenbrunner 2005-08-27, 7:23 am |
| Dave Page wrote:
> Patch applied with port directory added as discussed, and a couple of
> minor fixes.
>
> Slony will now work out of the box on Windows, albeit currently lacking
> service code and proper event logging. :-)
>
> (Also tested on Linux prior to commit - all seems OK).
FYI: this patch is a serious regression on all unix-platforms.
It breaks compilation against 7.3 and 7.4 installations because the
pipread/pipewrite stuff is not defined in these versions (which is
obvious since those predate the native win32 port of postgresql).
Adding the missing defines (from a 8.x port.h include) makes slon at
least compile again.
Stefan
| |
| Magnus Hagander 2005-08-30, 1:27 pm |
| > > Patch applied with port directory added as discussed, and a
> couple of
>
> FYI: this patch is a serious regression on all unix-platforms.
> It breaks compilation against 7.3 and 7.4 installations
> because the pipread/pipewrite stuff is not defined in these
> versions (which is obvious since those predate the native
> win32 port of postgresql).
> Adding the missing defines (from a 8.x port.h include) makes
> slon at least compile again.
Oops, my bad, sorry about that. Forgot to test with pre-8.0, but at
least I remembered to test on linux :-)
Here's a patch that fixes this (it basically does what you have already
done..)
//Magnus
| |
| Stefan Kaltenbrunner 2005-08-31, 11:24 am |
| Magnus Hagander wrote:
>
>
> Oops, my bad, sorry about that. Forgot to test with pre-8.0, but at
> least I remembered to test on linux :-)
>
> Here's a patch that fixes this (it basically does what you have already
> done..)
thanks - works for me (as commited to -HEAD by Darcy)
Stefan
|
|
|
|
|