Post Aerospike 3.8 XDR logs do not rotate
In Aerospike 3.8 and higher XDR functionality is contained within the main Aerospike process (asd) and so by default, XDR logs are written to the main aerospike.log. It is possible, if desired, to continue writing XDR log messages to a separate asxdr.log file. In this configuration, when log rotate rotates the log file, asxdr.log may not rotate properly.
This is caused by the fact that there is no separate asxdr process anymore. When log rotate rotates the log file it issues a hup to the Aerospike process as follows:
postrotate kill -HUP `pidof asd` endscript
When this command runs, after rotation of aerospike.log both logs are truncated.
The solution to this issue is to replace the hup with the following command:
postrotate copytruncate endscript
The copytruncate command tells logrotate to copy the file and truncate in place rather than sending a hup
- Logrotate man page:
- Retaining asxdr.log in post 3. XDR architecture.
XDR ASXDR LOGGING LOGROTATE
12st September 2016