Thread: pg_autovacuum Win32 service patch #2

pg_autovacuum Win32 service patch #2

From
"Dave Page"
Date:
[Third attempt to send this - dunno where they're all going!]

I forgot to CC the start of this to -hackers last time - please see
http://archives.postgresql.org/pgsql-hackers-win32/2004-05/msg00034.php
for background.

Following Magnus' suggestions yesterday I made the following changes:

- The event source is now "PostgreSQL Auto Vacuum"
- Error levels have been added to the error handler to standardise log
entry format and allow use of Win32 event types.
- When installing as a windows service the following options can be used
to specify the uid/pwd to run the service as:

  -N <username>
  -W <password>

- Other options specified when installing as a service are stored in the
registry for use each startup, INCLUDING DATABASE PASSWORD.

In addition, I've also cleaned up the service startup code so that it
terminates properly if there is an error at startup, and modified
InstallService and RemoveService to register/deregister the service as
an event source.

Any comments/criticisms/gasps of horror at all the win32 code? :-)

Regards, Dave

Attachment

Re: pg_autovacuum Win32 service patch #2

From
"Matthew T. O'Connor"
Date:
Dave Page wrote:

>Any comments/criticisms/gasps of horror at all the win32 code? :-)
>

Sorry for not jumping in sooner but I have been offline for several days.

Anyway, not having looked at this at all, how will this be effected when
pg_autovacuum is integrated into the backend.  I assume that the
postmaster can be run as a win32 service, and if it launches and kills
pg_autovacuum automatically, do you need to do anything for pg_autovacuum?

Matthew


Re: pg_autovacuum Win32 service patch #2

From
"Dave Page"
Date:

> -----Original Message-----
> From: Matthew T. O'Connor [mailto:matthew@zeut.net]
> Sent: 13 May 2004 21:40
> To: Dave Page
> Cc: pgsql-hackers-win32@postgresql.org; pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] pg_autovacuum Win32 service patch #2
>
> Anyway, not having looked at this at all, how will this be
> effected when pg_autovacuum is integrated into the backend.
> I assume that the postmaster can be run as a win32 service,
> and if it launches and kills pg_autovacuum automatically, do
> you need to do anything for pg_autovacuum?

When it becomes part of the backend, the service code I've added will be
junked. I've not looked at it in detail, but for the most part I imagine
VacuumLoop() (which is where I moved the main loop to) will be tweaked
and called from PostmasterMain (much as the stats collector is).

Regards, Dave.