Github user suyogmapara commented on the issue:
https://github.com/apache/zookeeper/pull/567
Hi @maoling
Regarding 1, preAllocSize controls how big the contiguous region of
transaction file would be on disk (to reduce number seeks you need to do) while
this feature controls how big the file size would be before we roll to the next
transaction log. It would make sense to set later one as some multiple of the
first one. If you set both values closers or if preAllocSize is smaller, you
are right you would get very frequent log rolls (maybe for every transaction in
1.2), but as far as I can think of it shouldn't impact correctness. I don't
have checks against such values mainly because it is not clear what is the
minimum value I should allow. Basically the same reason we don't have check
against setting snapCount = 2, for example.
Regarding your example, can you please elaborate your values in 1.1?
Regarding 2, during diff sync, leader will seek for the last transaction
follower has seen in the in-memory committed log cache. If the zxid is older
than oldest transaction then leader has to first send over the transactions
from the earlier transaction log file. For starting the stream of transaction,
leader has to do a linear search for the zxid, in the transaction log (as we
don't have an index over it). Larger the transaction log file, longer it takes.
It can happen if you have especially larger individual transactions. This
feature give you control over the maximum size.
---