You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Sijie Guo (JIRA)" <ji...@apache.org> on 2013/07/26 03:32:47 UTC

[jira] [Commented] (BOOKKEEPER-596) Ledgers are gc'ed by mistake in MSLedgerManagerFactory.

    [ https://issues.apache.org/jira/browse/BOOKKEEPER-596?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13720342#comment-13720342 ] 

Sijie Guo commented on BOOKKEEPER-596:
--------------------------------------

[~merlimat]

I guessed I found the root cause. it is a bug introduce in this patch, where Ivan refactored the LedgerRange.

int HierarchicalLedgerManager, the subSet is misused, which exclude the last ledger id. 
http://docs.oracle.com/javase/6/docs/api/java/util/SortedSet.html#subSet(E, E)
{code}
            return new LedgerRange(zkActiveLedgers.subSet(getStartLedgerIdByLevel(level1, level2),
                                                          getEndLedgerIdByLevel(level1, level2)));
{code}

so the last ledger in each level would be gc'ed. it is easy to reproduce this issue and fix it.
                
> Ledgers are gc'ed by mistake in MSLedgerManagerFactory.
> -------------------------------------------------------
>
>                 Key: BOOKKEEPER-596
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-596
>             Project: Bookkeeper
>          Issue Type: Bug
>    Affects Versions: 4.2.0, 4.2.1
>            Reporter: Sijie Guo
>            Assignee: Sijie Guo
>            Priority: Blocker
>             Fix For: 4.2.2, 4.3.0
>
>         Attachments: 0001-BOOKKEEPER-596-Ledgers-are-gc-ed-by-mistake-in-MSLed.patch, 0001-BOOKKEEPER-596-Ledgers-are-gc-ed-by-mistake-in-MSLed.patch, BOOKKEEPER-596.patch, BOOKKEEPER-596.patch, BOOKKEEPER-596.patch
>
>
> details: https://issues.apache.org/jira/browse/BOOKKEEPER-590?focusedCommentId=13616397&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13616397

--
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