[
https://issues.apache.org/jira/browse/KAFKA-1646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14164557#comment-14164557
]
Jay Kreps commented on KAFKA-1646:
----------------------------------
Interesting. What is the behavior of RandomAccessFile.setLength(size) when
setting a size larger than the current file size on Windows? Does it fully
preallocate all the blocks up to the full length? If so does that cause any
kind of pause if you are allocating like 1GB? On Linux it does "sparse"
allocation which doesn't actually assign any blocks it just fills it in with
fake zeros--so that happens very quickly but doesn't help with getting linear
reads. Presumably Windows is also treating the unwritten part of the file as
all zeros.
How do you handle file close? If the broker is running and is hard killed we
run recovery and would truncate off any trailing zeros in a log segment.
However if the broker is stopped gracefully I don't see how the trailing zeros
are truncated off so on restart don't you end up with a bunch of zeros in the
log?
> Improve consumer read performance for Windows
> ---------------------------------------------
>
> Key: KAFKA-1646
> URL: https://issues.apache.org/jira/browse/KAFKA-1646
> Project: Kafka
> Issue Type: Improvement
> Components: log
> Affects Versions: 0.8.1.1
> Environment: Windows
> Reporter: xueqiang wang
> Labels: newbie, patch
> Attachments: Improve consumer read performance for Windows.patch
>
>
> This patch is for Window platform only. In Windows platform, if there are
> more than one replicas writing to disk, the segment log files will not be
> consistent in disk and then consumer reading performance will be dropped down
> greatly. This fix allocates more disk spaces when rolling a new segment, and
> then it will improve the consumer reading performance in NTFS file system.
> This patch doesn't affect file allocation of other filesystems, for it only
> adds statements like 'if(Os.iswindow)' or adds methods used on Windows.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)