[
https://issues.apache.org/jira/browse/KAFKA-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13817195#comment-13817195
]
Jan commented on KAFKA-1036:
----------------------------
Hi all,
I think the problem is that the second check for renameTo == true fails
although the rename was executed properly. When I remove the second check, it
works without problems and the file gets renamed properly (see the attached
patch). I guess the root cause of this problem is the platform dependency of
the old File API:
Many aspects of the behavior of this method are inherently platform-dependent:
The rename operation might not be able to move a file from one filesystem to
another, it might not be atomic, and it might not succeed if a file with the
destination abstract pathname already exists
Maybe it would be a solution to use NIO instead?
Best regards
Jan
> Unable to rename replication offset checkpoint in windows
> ---------------------------------------------------------
>
> Key: KAFKA-1036
> URL: https://issues.apache.org/jira/browse/KAFKA-1036
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 0.8.1
> Environment: windows
> Reporter: Timothy Chen
> Priority: Critical
> Labels: windows
> Fix For: 0.8.1
>
>
> Although there was a fix for checkpoint file renaming in windows that tries
> to delete the existing checkpoint file if renamed failed, I'm still seeing
> renaming errors on windows even though the destination file doesn't exist.
> A bit investigation shows that it wasn't able to rename the file since the
> kafka jvm still holds a fie lock on the tmp file and wasn't able to rename
> it.
> Attaching a patch that calls a explict writer.close so it can release the
> lock and can able to rename it.
--
This message was sent by Atlassian JIRA
(v6.1#6144)