Project

General

Profile

Tasks #11797

does our log rotation do the right thing?

Added by Greg Farnum about 4 years ago. Updated about 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
05/27/2015
Due date:
% Done:

0%

Tags:
Reviewed:
Affected Versions:
Pull request ID:

Description

Our logrotate.conf file uses the rotate, compress, and sharedscripts flags, and has a postrotate script which sends a signal telling the daemon to change log files.

As I read the logrotate man page (http://linux.die.net/man/8/logrotate), the order these are invoked is:
for each Ceph file:
  • move file to new location
  • compress file
and then
  • invoke postrotate script

So I think there might be a race here where we rotate a file, compress it while it's still being written to, and then switch to a new file. The delaycompress flag will wait until the next rotation period to do the actual compression, which would close the race but obviously doesn't let you compress quickly.
Or maybe I'm misreading the man page, or it's just lying: in my understanding it's basically impossible to use logrotate sanely to avoid this race...

History

#1 Updated by Greg Farnum about 4 years ago

  • Status changed from New to Rejected

Our log rotation does do the right thing. Running in debug mode makes clear that the compression happens after the postrotate script is done. :)

Also available in: Atom PDF