[erlang-questions] disk_log bug?

Todd Lipcon todd@REDACTED
Fri Aug 15 17:14:18 CEST 2008

Hi all,

I'm using disk_log to log binary data in wrap mode. I'm writing each element
of data using disk_log:balog(Log, erlang:iolist_to_binary(Data)). I'm using
timer:apply_interval to call disk_log:sync(Log) every couple of seconds.

The problem I'm experiencing is that it seems like the disk_log is
occasionally overwriting the ends of previous records at 4K byte boundaries.
For example, the data in the file looks like:


where '*' represents a 4K byte boundary in the file. The data marked 'D' is
several hundred bytes long but gets truncated at the boundary and
overwritten by E.

I've logged several gigs of data using this system and only occasionally
does a file get in the sort of "mode" where this happens. Once it starts
happening, there are hundreds of points in the file that exhibit the
problem. After forcing the disk_log to wrap to a new file, the new file does
not exhibit the problem.

Any thoughts? Platform is beam 5.6.2, R12B-2, Linux 2.6.22 amd64

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080815/657495ff/attachment.htm>

More information about the erlang-questions mailing list