提交 14a794e8 编写于 作者: J Jacob Champion 提交者: Shoaib Lari

SysLoggerMain: fix timestamp delay code

Log rotations were happening well after the timestamp on the log file
(e.g. a per-minute rotation might actually take place thirty seconds
after it was supposed to).

After the 9.2 merge, we were incorrectly shadowing the `now` variable,
so the rotation delay only got bigger and bigger. Periodic logging (such
as from FTS) caused us to break out of the wait by luck, but otherwise
the syslogger would take longer and longer to wake up to perform a
rotation.
Co-authored-by: NJamie McAtamney <jmcatamney@pivotal.io>
上级 943a3d22
......@@ -497,8 +497,7 @@ SysLoggerMain(int argc, char *argv[])
if (Log_RotationAge > 0 && !rotation_disabled)
{
/* Do a logfile rotation if it's time */
pg_time_t now = (pg_time_t) time(NULL);
now = (pg_time_t) time(NULL);
if (now >= next_rotation_time)
{
rotation_requested = time_based_rotation = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册