Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-06-09 Thread Magnus Hagander
On Mon, May 23, 2011 at 16:49, MauMau maumau...@gmail.com wrote:
 From: Kevin Grittner kevin.gritt...@wicourts.gov

 MauMau maumau...@gmail.com wrote:

 Make pg_ctl's -s option suppress informational event logging.

 This will ultimately be up to a committer (and I'm not one), but to
 me it seems reasonable to back-patch if it is addressed this way.


 the PostgreSQL Windows service must be registered by pg_ctl
 register -s to make use of this patch. However, according to the
 current manual, pg_ctl register does not take -s option.
 Actually, pg_ctl does not refuse to take -s, so this is not a big
 problem.

 pg_ctl register [-N servicename] [-U username] [-P password]
 [-D datadir] [-w] [-t seconds] [-o options]

 When you write the patch, be sure to include a fix for the docs
 here, please.


 I attached a patch to fix this bug. I performed the following tests
 successfully on Windows Vista (32-bit).

snip test cases

 I wish this will be back-patched in the next minor release.

Thanks, sorry about the delay, patch applied. I backpatched it back to
8.3 which is as far as it applied cleanly - I'm not excited enough
about it to bother a manual backpatch to 8.2.

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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-06-09 Thread MauMau

From: Magnus Hagander mag...@hagander.net
Thanks, sorry about the delay, patch applied. I backpatched it back to
8.3 which is as far as it applied cleanly - I'm not excited enough
about it to bother a manual backpatch to 8.2.

Thank you very much, Magnus. I don't mind 8.2 as = 8.3 is enough for me.

Regards
MauMau


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-05-23 Thread MauMau

From: Kevin Grittner kevin.gritt...@wicourts.gov

MauMau maumau...@gmail.com wrote:

Make pg_ctl's -s option suppress informational event logging.


This will ultimately be up to a committer (and I'm not one), but to
me it seems reasonable to back-patch if it is addressed this way.



the PostgreSQL Windows service must be registered by pg_ctl
register -s to make use of this patch. However, according to the
current manual, pg_ctl register does not take -s option.
Actually, pg_ctl does not refuse to take -s, so this is not a big
problem.

pg_ctl register [-N servicename] [-U username] [-P password]
[-D datadir] [-w] [-t seconds] [-o options]


When you write the patch, be sure to include a fix for the docs
here, please.



I attached a patch to fix this bug. I performed the following tests 
successfully on Windows Vista (32-bit).


[test case 1]
pg_ctl register -s ...
start PostgreSQL as Windows service from the Control Panel
[result]
The following two messages in question disappeared in event log:

Waiting for server startup...
Server started and accepting connections

[test case 2]
pg_ctl register -s ...
start PostgreSQL not as Windows service (pg_ctl start -w)
[result]
The above messages didn't appear in event log (the same behavior as before)

[test case 3]
pg_ctl register ... (without -s)
start PostgreSQL as Windows service from the Control Panel
[result]
The above messages appeared in event log (the same behavior as before)

[test case 4]
pg_ctl register ... (without -s)
start PostgreSQL not as Windows service (pg_ctl start -w)
[result]
The above messages didn't appear in event log (the same behavior as before)

I wish this will be back-patched in the next minor release.

Regards
MauMau



suppress_info_messages.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-05-13 Thread MauMau

From: Robert Haas robertmh...@gmail.com
On Thu, May 12, 2011 at 2:57 PM, Kevin Grittner
kevin.gritt...@wicourts.gov wrote:

I wish the fix will be back-patched in 8.3, too.


I guess the question is whether this is a bug which causes more
problems than the potential breakage which might ensue for someone
who relies on the current behavior. How sure can you be that nobody
relies on seeing those messages? No information (like a history of
database start times) is lost without these entries?



I think Tom had the right idea upthread: what we should do is make the
-s option to pg_ctl suppress these messages (as it does with similar
messages on Linux).  Removing them altogether seems like overkill, for
the reasons you mention.



Thank you, Magnus, Tom, Dave, Kevin, and Robert. Maybe I could get a 
consensus of opinion on the treatment of bug #6011. The summary is shown 
below. However, as mentioned previously, there are some concerns. So I'll 
wait for more opinions for a week, then write and test a patch, and submit 
it as a reply to this mail thread.



How to treat

Treat it as a bug. (I hope some committer will kindly back-patch to older 
versions.)


Make pg_ctl's -s option suppress informational event logging. The 
modifications are:


1. write_event_log() (pg_ctl.c)
If -s was specified and the level argument is EVENTLOG_INFORMATION_TYPE, 
just return without doing anything.


2. pgwin32_CommandLine() (pg_ctl.c)
If -s was specified when running pg_ctl register, add -s to pg_ctl 
runservice command line built in this function.



Concerns

Existing software which use PostgreSQL needs to be modified to add -s to 
pg_ctl. Moreover, pg_ctl unregister and pg_ctl register must be performed to 
make the patch effective in existing installations.


The two messages in question may be just annoying to users, and they might 
want those messages to disappear without -s. They claim that it is 
inconsistent that those messages are not recorded in syslog on UNIX/Linux.


As described in How to treat, the PostgreSQL Windows service must be 
registered by pg_ctl register -s to make use of this patch. However, 
according to the current manual, pg_ctl register does not take -s option. 
Actually, pg_ctl does not refuse to take -s, so this is not a big problem.


pg_ctl register [-N servicename] [-U username] [-P password] [-D datadir] 
[-w] [-t seconds] [-o options]

Regards,
MauMau


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-05-13 Thread Kevin Grittner
MauMau maumau...@gmail.com wrote:
 From: Robert Haas robertmh...@gmail.com
 
 I think Tom had the right idea upthread: what we should do is
 make the -s option to pg_ctl suppress these messages (as it
 does with similar messages on Linux).  Removing them altogether
 seems like overkill, for the reasons you mention.
 
Agreed.
 
 So I'll wait for more opinions for a week, then write and test a
 patch, and submit it as a reply to this mail thread.
 
Sounds reasonable.
 
 Treat it as a bug. (I hope some committer will kindly back-patch
 to older versions.)
 
 Make pg_ctl's -s option suppress informational event logging.
 
This will ultimately be up to a committer (and I'm not one), but to
me it seems reasonable to back-patch if it is addressed this way.
 
 Existing software which use PostgreSQL needs to be modified to add
 -s to pg_ctl. Moreover, pg_ctl unregister and pg_ctl register must
 be performed to make the patch effective in existing
 installations.
 
That is probably a very *good* thing if you want it to be considered
for back-patch.  Having a bug fix release arbitrarily change
existing behavior which isn't data-destroying or a security risk is
not a good thing and is contrary to PostgreSQL policy for
maintaining stable branches.  We can't know who might be, for
example, pulling such messages out of their logs for reporting or
monitoring purposes.  If we made changes that can conceivably break
things on applying bug fix releases, we would have fewer people
applying them, and that would be bad for everyone.
 
 The two messages in question may be just annoying to users, and
 they might want those messages to disappear without -s. They claim
 that it is inconsistent that those messages are not recorded in
 syslog on UNIX/Linux.
 
I can only dream of what it's like to work somewhere that fussing
over two informational log messages on an infrequent event like
restarting a database (that *is* an infrequent event, right?) would
be something I had time for.  They are very fortunate people to be
in such a position.  It would appear that finding the time to add
the -s switch shouldn't be too hard in such an environment.
 
 the PostgreSQL Windows service must be registered by pg_ctl
 register -s to make use of this patch. However, according to the
 current manual, pg_ctl register does not take -s option.
 Actually, pg_ctl does not refuse to take -s, so this is not a big
 problem.
 
 pg_ctl register [-N servicename] [-U username] [-P password]
 [-D datadir] [-w] [-t seconds] [-o options]
 
When you write the patch, be sure to include a fix for the docs
here, please.
 
Thanks for taking the time to work through the issue.
 
-Kevin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-05-12 Thread Kevin Grittner
MauMau maumau...@gmail.com wrote:
 
 I'm sorry to interrupt you, but how should I treat this bug report
 I issued?  Should I submit a bug fix patch for the latest source
 code (=v9.1)?
 
Patches should always be submitted against the HEAD of the master
branch.
 
 I wish the fix will be back-patched in 8.3, too.
 
I guess the question is whether this is a bug which causes more
problems than the potential breakage which might ensue for someone
who relies on the current behavior.  How sure can you be that nobody
relies on seeing those messages?  No information (like a history of
database start times) is lost without these entries?
 
 If yes, I would like to get a concensus on the solution. As I
 mentioned, I think that it is enough to just remove the two 
 write_eventlog(EVENTLOG_INFORMATION_TYPE) calls.
 
Someone running at the command line would still get this feedback,
right?
 
 If the solution is okay, should I really submit a patch for just
 removing two lines?
 
That's the normal way to propose a change; even a small one.
 
 Or, can I expect that some committer will modify and commit the 
 change directly?
 
That might happen.  Your odds are better if you propose something
that a committer can review.  Most of the committers don't have
Windows readily available, so it would also boost your chances to
report on what testing you've done -- running at the command line
and as a service, what Windows version(s), etc.
 
-Kevin

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Fw: [BUGS] BUG #6011: Some extra messages are output in the event log at PostgreSQL startup

2011-05-12 Thread Robert Haas
On Thu, May 12, 2011 at 2:57 PM, Kevin Grittner
kevin.gritt...@wicourts.gov wrote:
 I wish the fix will be back-patched in 8.3, too.

 I guess the question is whether this is a bug which causes more
 problems than the potential breakage which might ensue for someone
 who relies on the current behavior.  How sure can you be that nobody
 relies on seeing those messages?  No information (like a history of
 database start times) is lost without these entries?

I think Tom had the right idea upthread: what we should do is make the
-s option to pg_ctl suppress these messages (as it does with similar
messages on Linux).  Removing them altogether seems like overkill, for
the reasons you mention.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers