[
https://issues.apache.org/jira/browse/HADOOP-5314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12705082#action_12705082
]
Konstantin Shvachko commented on HADOOP-5314:
---------------------------------------------
I think this should solve the problem:
{code}
checkpointTime = readCheckpointTime(sd);
needToSave |= (!editsExists);
needToSave |= (!imageExists);
if (sd.getStorageDirType().isOfType(NameNodeDirType.IMAGE) &&
(latestNameCheckpointTime < checkpointTime) && imageExists) {
// Force saving of new image if checkpoint time
// is not same in all of the storage directories.
if ((latestNameCheckpointTime != Long.MIN_VALUE) &&
(checkpointTime != latestNameCheckpointTime)) {
needToSave |= true;
}
latestNameCheckpointTime = checkpointTime;
latestNameSD = sd;
}
if (sd.getStorageDirType().isOfType(NameNodeDirType.EDITS) &&
(latestEditsCheckpointTime < checkpointTime) && editsExists) {
// Force saving of new image if checkpoint time
// is not same in all of the storage directories.
if ((latestEditsCheckpointTime != Long.MIN_VALUE) &&
(checkpointTime != latestNameCheckpointTime)) {
needToSave |= true;
}
latestEditsCheckpointTime = checkpointTime;
latestEditsSD = sd;
}
{code}
> needToSave incorrectly calculated in loadFSImage()
> --------------------------------------------------
>
> Key: HADOOP-5314
> URL: https://issues.apache.org/jira/browse/HADOOP-5314
> Project: Hadoop Core
> Issue Type: Bug
> Components: dfs
> Affects Versions: 0.19.0
> Reporter: Konstantin Shvachko
> Assignee: Jakob Homan
> Fix For: 0.19.2
>
>
> {{FSImage.loadFSImage()}} incorrectly calculates the value of {{needToSave}},
> which is always true and results in saving image at startup even if that is
> not necessary.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.