Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8556869

Browse files
committed
Fix failure to rotate postmaster log file for size reasons on Windows.
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
1 parent ca5db75 commit 8556869

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/backend/postmaster/syslogger.c

+9
Original file line numberDiff line numberDiff line change
@@ -1059,6 +1059,15 @@ pipeThread(void *arg)
10591059
bytes_in_logbuffer += bytesRead;
10601060
process_pipe_input(logbuffer, &bytes_in_logbuffer);
10611061
}
1062+
1063+
/*
1064+
* If we've filled the current logfile, nudge the main thread to do a
1065+
* log rotation.
1066+
*/
1067+
if (Log_RotationSize > 0 &&
1068+
ftell(syslogFile) >= Log_RotationSize * 1024L)
1069+
SetLatch(&sysLoggerLatch);
1070+
10621071
LeaveCriticalSection(&sysloggerSection);
10631072
}
10641073

0 commit comments

Comments
 (0)