directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selcuk AYA <ayasel...@gmail.com>
Subject Re: [Txns] Log implementation issues
Date Wed, 26 Oct 2011 16:59:10 GMT
On Wed, Oct 26, 2011 at 7:01 PM, Emmanuel Lecharny <elecharny@gmail.com> wrote:
> Hi,
>
> it seems there is an issue in the way he Log is dealing with data spanning
> over multiple files : if the lat buffer is nt written to the disk, for
> instance if we don't flush every time we log, then the inner buffer is never
> written to disk. Scanning the entries will then never read the last logs we
> injected into the logger.

There is no issue. What you say is expected and is not related to
records spanning multiple log files. When you log data and you do not
sync it, that data will stay in the internal in memory buffer until
somebody else syncs the data or the internal buffer fills up.
Currently scanner reads only from the on disk log files. See below.

>
> I have added a LogTest test to demonstrate the problem (the test will pass,
> because I have added a assertEquals that won't dail at the end).
>
> We should add a sync() method to the Log interface, allowing a user to flush
> the inner buffer to disk. Currently, the only option is to flush when we do
> a log(), which is not very convenient when writing small pieces of data.

Currently what you would do in such a case is:

log(small data, false); log(small data, false);.....log(final small data, true);

instead of :

log(small data); log(small data);.....log(final small data), sync().

maybe the second interface is more convenient and I was also thinking
of adding a similar interface but I dont see an issue.
>
> --
> Regards,
> Cordialement,
> Emmanuel L├ęcharny
> www.iktek.com
>
>

Mime
View raw message