Various fixes for syslogger

Started by ITAGAKI Takahiroalmost 19 years ago4 messagespatches
Jump to latest
#1ITAGAKI Takahiro
itagaki.takahiro@oss.ntt.co.jp

Here are various fixes for syslogger.

- syslogger_parseArgs_assert.patch (bug #3621)
The assertion in syslogger_parseArgs() was wrong. The number of
arguments passed to syslogger is changed to 4 in 8.1 or later.
This patch should be appled to 8.1, 8.2 and 8.3dev.

- logfile_rotate.patch (bug #3622)
This patch fixes two bugs in the log file rotation.
This is only for 8.3dev.
1. pg_rotate_logfile() force log files to rotate. Both .log and .csv
files are treated the same way as size-limited rotation.
2. Fix a copy-and-paste bug in updating csvlogFile. CSV log was lost
after swiching files in all case of the rotations.

- remove_redirect_stderr.patch
redirect_stderr is renamed to logging_collector, but the old name
is left in postgresql.conf. This is only for 8.3dev.

BTW, I found empty .log files are created under $PGDATA/pg_log/ even if
log_destination does not contain 'stderr' (i.e, only csvlog or syslog).
Is this an intentional behavior?

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachments:

remove_redirect_stderr.patchapplication/octet-stream; name=remove_redirect_stderr.patchDownload+1-1
syslogger_parseArgs_assert.patchapplication/octet-stream; name=syslogger_parseArgs_assert.patchDownload+1-1
logfile_rotate.patchapplication/octet-stream; name=logfile_rotate.patchDownload+9-1
#2Andrew Dunstan
andrew@dunslane.net
In reply to: ITAGAKI Takahiro (#1)
Re: Various fixes for syslogger

ITAGAKI Takahiro wrote:

Here are various fixes for syslogger.

- syslogger_parseArgs_assert.patch (bug #3621)
The assertion in syslogger_parseArgs() was wrong. The number of
arguments passed to syslogger is changed to 4 in 8.1 or later.
This patch should be appled to 8.1, 8.2 and 8.3dev.

Hi,

Can you pinpoint where this change in argv/argc was made? I'm having
trouble locating it.

Thanks

andrew

#3ITAGAKI Takahiro
itagaki.takahiro@oss.ntt.co.jp
In reply to: Andrew Dunstan (#2)
Re: Various fixes for syslogger

Andrew Dunstan <andrew@dunslane.net> wrote:

- syslogger_parseArgs_assert.patch (bug #3621)
The assertion in syslogger_parseArgs() was wrong. The number of
arguments passed to syslogger is changed to 4 in 8.1 or later.
This patch should be appled to 8.1, 8.2 and 8.3dev.

Can you pinpoint where this change in argv/argc was made? I'm having
trouble locating it.

Oops, I misread the codes. There was the same bug in 8.0, too.
Therefore, the fix should be appled to 8.0, 8.1, 8.2 and 8.3dev.
We've had the bug in all versions after syslogger was added.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: ITAGAKI Takahiro (#3)
Re: Various fixes for syslogger

ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:

Andrew Dunstan <andrew@dunslane.net> wrote:

Can you pinpoint where this change in argv/argc was made? I'm having
trouble locating it.

Oops, I misread the codes. There was the same bug in 8.0, too.
Therefore, the fix should be appled to 8.0, 8.1, 8.2 and 8.3dev.
We've had the bug in all versions after syslogger was added.

I've applied this fix, but only as far back as 8.2, on two grounds:
1. It's only likely to be of interest to developers.
2. We are no longer supporting 8.0 or 8.1 on Windows.

While it's theoretically not a Windows-specific bug, in practice
no one is going to use the EXEC_BACKEND option on other platforms.

regards, tom lane