- Jan 24, 2013
-
-
Tom Lane authored
When we eliminated "unnecessary" wakeups of the syslogger process, we broke size-based logfile rotation on Windows, because on that platform data transfer is done in a separate thread. While non-Windows platforms would recheck the output file size after every log message, Windows only did so when the control thread woke up for some other reason, which might be quite infrequent. Per bug #7814 from Tsunezumi. Back-patch to 9.2 where the problem was introduced. Jeff Janes
-
- Jan 01, 2013
-
-
Bruce Momjian authored
Fully update git head, and update back branches in ./COPYRIGHT and legal.sgml files.
-
- Nov 18, 2012
-
-
Tom Lane authored
We need to avoid calling WaitLatch with timeouts exceeding INT_MAX. Fortunately a simple clamp will do the trick, since no harm is done if the wait times out before it's really time to rotate the log file. Per bug #7670 (probably bug #7545 is the same thing, too). In passing, fix bogus definition of log_rotation_age's maximum value in guc.c --- it was numerically right, but only because MINS_PER_HOUR and SECS_PER_MINUTE have the same value. Back-patch to 9.2. Before that, syslogger wasn't using WaitLatch.
-
- Oct 15, 2012
-
-
Tom Lane authored
In the previous coding, new backend processes would attempt to create their self-pipe during the OwnLatch call in InitProcess. However, pipe creation could fail if the kernel is short of resources; and the system does not recover gracefully from a FATAL error right there, since we have armed the dead-man switch for this process and not yet set up the on_shmem_exit callback that would disarm it. The postmaster then forces an unnecessary database-wide crash and restart, as reported by Sean Chittenden. There are various ways we could rearrange the code to fix this, but the simplest and sanest seems to be to split out creation of the self-pipe into a new function InitializeLatchSupport, which must be called from a place where failure is allowed. For most processes that gets called in InitProcess or InitAuxiliaryProcess, but processes that don't call either but still use latches need their own calls. Back-patch to 9.1, which has only a part of the latch logic that 9.2 and HEAD have, but nonetheless includes this bug.
-
- Jul 31, 2012
-
-
Tom Lane authored
In the original coding of the log rotation stuff, we did not bother to make the truncation logic work for the very first rotation after postmaster start (or after a syslogger crash and restart). It just always appended in that case. It did not seem terribly important at the time, but we've recently had two separate complaints from people who expected it to work unsurprisingly. (Both users tend to restart the postmaster about as often as a log rotation is configured to happen, which is maybe not typical use, but still...) Since the initial log file is opened in the postmaster, fixing this requires passing down some more state to the syslogger child process. It's always been like this, so back-patch to all supported branches.
-
- Jun 25, 2012
-
-
Peter Eisentraut authored
There was a wild mix of calling conventions: Some were declared to return void and didn't return, some returned an int exit code, some claimed to return an exit code, which the callers checked, but actually never returned, and so on. Now all of these functions are declared to return void and decorated with attribute noreturn and don't return. That's easiest, and most code already worked that way.
-
- Jun 10, 2012
-
-
Bruce Momjian authored
commit-fest.
-
- May 13, 2012
-
-
Tom Lane authored
syslogger was coded to wake up once per second whether there was anything useful to do or not. As part of our campaign to reduce the server's idle power consumption, change it to use a latch for waiting. Now, in the absence of any data to log or any signals to service, it will only wake up at the programmed logfile rotation times (if any).
-
- Apr 27, 2012
-
-
Tom Lane authored
If it fails to open a new log file, the syslogger assumes there's something wrong with its parameters (such as log_directory), and stops attempting automatic time-based or size-based log file rotations. Sending it SIGHUP is supposed to start that up again. However, the original coding for that was really bogus, involving clobbering a couple of GUC variables and hoping that SIGHUP processing would restore them. Get rid of that technique in favor of maintaining a separate flag showing we've turned rotation off. Per report from Mark Kirkwood. Also, the syslogger will automatically attempt to create the log_directory directory if it doesn't exist, but that was only happening at startup. For consistency and ease of use, it should do the same whenever the value of log_directory is changed by SIGHUP. Back-patch to all supported branches.
-
- Apr 04, 2012
-
-
Tom Lane authored
The original coding of the syslogger had an arbitrary limit of 20 large messages concurrently in progress, after which it would just punt and dump message fragments to the output file separately. Our ambitions are a bit higher than that now, so allow the data structure to expand as necessary. Reported and patched by Andrew Dunstan; some editing by Tom
-
- Mar 29, 2012
-
-
Andrew Dunstan authored
-
- Feb 21, 2012
-
-
Magnus Hagander authored
This causes an exception when running under a debugger or in particular when running on a debug version of Windows. Patch from MauMau
-
- Jan 02, 2012
-
-
Bruce Momjian authored
-
- Apr 28, 2011
-
-
Andrew Dunstan authored
-
- Apr 10, 2011
-
-
Bruce Momjian authored
-
- Jan 01, 2011
-
-
Bruce Momjian authored
-
- Dec 10, 2010
-
-
Tom Lane authored
Purely cosmetic patch to make our coding standards more consistent --- we were doing symbolic some places and octal other places. This patch fixes all C-coded uses of mkdir, chmod, and umask. There might be some other calls I missed. Inconsistency noted while researching tablespace directory permissions issue.
-
- Sep 20, 2010
-
-
Magnus Hagander authored
-
- Jul 17, 2010
-
-
Tom Lane authored
log files created by the syslogger process. In passing, make unix_file_permissions display its value in octal, same as log_file_mode now does. Martin Pihlak
-
- Jul 06, 2010
-
-
Bruce Momjian authored
-
- Apr 16, 2010
-
-
Heikki Linnakangas authored
reload and rotation signals, and a helper thread reads messages from the pipe and writes them to the log file. However, server code isn't generally thread-safe, so if both try to do e.g palloc()/pfree() at the same time, bad things will happen. To fix that, use a critical section (which is like a mutex) to enforce that only one the threads are active at a time.
-
- Apr 01, 2010
-
-
Heikki Linnakangas authored
Windows, thanks to a feature in CRT called Parameter Validation. Backpatch to 8.2, which is the oldest version supported on Windows. In 8.2 and 8.3 also backpatch the earlier change to use DEVNULL instead of NULL_DEV #define for a /dev/null-like device. NULL_DEV was hard-coded to "/dev/null" regardless of platform, which didn't work on Windows, while DEVNULL works on all platforms. Restarting syslogger didn't work on Windows on versions 8.3 and below because of that.
-
- Jan 02, 2010
-
-
Bruce Momjian authored
-
Magnus Hagander authored
Tsutomu Yamada
-
- Nov 19, 2009
-
-
Tom Lane authored
output filename if CSV logging was enabled and only one of the two possible output files got rotated during a particular call (which would, in fact, typically be the case during a size-based rotation). This would amount to about MAXPGPATH (1KB) per rotation, and it's been there since the CSV code was put in, so it's surprising that nobody noticed it before. Per bug #5196 from Thomas Poindessous.
-
- Nov 05, 2009
-
-
Peter Eisentraut authored
Pointed out by Debian's lintian.
-
- Jun 11, 2009
-
-
Bruce Momjian authored
provided by Andrew.
-
- Mar 18, 2009
-
-
Heikki Linnakangas authored
the cause of the "could not write to log file: Bad file descriptor" errors reported at http://archives.postgresql.org//pgsql-general/2008-06/msg00193.php Backpatch to 8.3, the race condition was introduced by the CSV logging patch. Analysis and patch by Gurjeet Singh.
-
- Feb 24, 2009
-
-
Peter Eisentraut authored
Robert Haas
-
- Feb 03, 2009
-
-
Tom Lane authored
unnecessary thread address output parameter, to make this code look more like that in pg_restore.
-
- Jan 01, 2009
-
-
Bruce Momjian authored
-
- Dec 11, 2008
-
-
Peter Eisentraut authored
platform-specific spellings of /dev/null. But one should be enough, so settle on DEVNULL.
-
- Feb 17, 2008
-
-
Tom Lane authored
data structures and backend internal APIs. This solves problems we've seen recently with inconsistent layout of pg_control between machines that have 32-bit time_t and those that have already migrated to 64-bit time_t. Also, we can get out from under the problem that Windows' Unix-API emulation is not consistent about the width of time_t. There are a few remaining places where local time_t variables are used to hold the current or recent result of time(NULL). I didn't bother changing these since they do not affect any cross-module APIs and surely all platforms will have 64-bit time_t before overflow becomes an actual risk. time_t should be avoided for anything visible to extension modules, however.
-
- Jan 25, 2008
-
-
Tom Lane authored
a double-pfree crash and another that effectively disabled size-based rotation for CSV logs. Also suppress a memory leak and make some trivial cosmetic improvements. Per bug #3901 from Chris Hoover and additional code-reading.
-
- Jan 01, 2008
-
-
Bruce Momjian authored
-
- Nov 15, 2007
-
-
Bruce Momjian authored
avoid this problem in the future.)
-
Bruce Momjian authored
-
- Sep 22, 2007
-
-
Tom Lane authored
per ITAGAKI Takahiro. Also, rewrite syslogger_forkexec() in hopes of eliminating the confusion in the first place.
-
- Sep 20, 2007
-
-
Andrew Dunstan authored
-
- Aug 21, 2007
-
-
Tom Lane authored
-