You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Ivan Kelly (JIRA)" <ji...@apache.org> on 2012/11/16 19:40:12 UTC
[jira] [Commented] (BOOKKEEPER-465) CreateNewLog may overwrite
lastLogId with smaller value
[ https://issues.apache.org/jira/browse/BOOKKEEPER-465?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499004#comment-13499004 ]
Ivan Kelly commented on BOOKKEEPER-465:
---------------------------------------
Marking as blocker for 4.2.0.
> CreateNewLog may overwrite lastLogId with smaller value
> --------------------------------------------------------
>
> Key: BOOKKEEPER-465
> URL: https://issues.apache.org/jira/browse/BOOKKEEPER-465
> Project: Bookkeeper
> Issue Type: Bug
> Affects Versions: 4.2.0
> Reporter: Yixue (Andrew) Zhu
> Assignee: Yixue (Andrew) Zhu
> Priority: Blocker
> Labels: patch
> Fix For: 4.2.0
>
>
> In createNewLog(), only one directory is searched to check for duplicate log id.
> Then the id is used to overwrite lastLogId.
> It looks like regression from BOOKKEEPER-345.
> // It would better not to overwrite existing entry log files
> File newLogFile = null;
> do {
> String logFileName = Long.toHexString(++logId) + ".log";
> File dir = ledgerDirsManager.pickRandomWritableDir();
> newLogFile = new File(dir, logFileName);
> currentDir = dir;
> if (newLogFile.exists()) {
> LOG.warn("Found existed entry log " + newLogFile
> + " when trying to create it as a new log.");
> newLogFile = null;
> continue;
> }
> } while (newLogFile == null);
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira