Queue data is deleted from disk after it has been successfully sent to the output.
This is not happening. Sent data still exists in the files (*.seg).
And to make matters worse, new log events are being inserted into the queue files even if they are sent successfully.
A segment file is deleted when all of the events currently in the segment file have been acknowledged by the Elasticsearch output. This can happen at any point in time depending on the rate data enters the queue relative to the rate is marked as acknowledged (or consumed) in the queue.
A segment can be up to queue.segement_size bytes in size, which defaults to queue.max_size / 10. In this case a segment can grow to be up to 1G in size before the queue will force a new segment to be created.
As far as I can tell the segment files are eventually being deleted unless I'm misinterpreting your comments. The only conditions the queue is guaranteed to maintain are:
The total disk space used by the queue segment files must be less than or equal to the configured max_size.
The total size of each segment file must be less than the configured segment_size.
The rest of the queue behaviour is really an implementation detail.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.