aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/postmaster/syslogger.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/postmaster/syslogger.c b/src/backend/postmaster/syslogger.c
index 1c62bfe03a2..534d69ec140 100644
--- a/src/backend/postmaster/syslogger.c
+++ b/src/backend/postmaster/syslogger.c
@@ -1059,6 +1059,15 @@ pipeThread(void *arg)
bytes_in_logbuffer += bytesRead;
process_pipe_input(logbuffer, &bytes_in_logbuffer);
}
+
+ /*
+ * If we've filled the current logfile, nudge the main thread to do a
+ * log rotation.
+ */
+ if (Log_RotationSize > 0 &&
+ ftell(syslogFile) >= Log_RotationSize * 1024L)
+ SetLatch(&sysLoggerLatch);
+
LeaveCriticalSection(&sysloggerSection);
}